/* Campbell Brothers Construction - self-hosted site */

:root {
  --navy: #1a2b5f;
  --navy-deep: #0f1a3a;
  --blue: #3a6ea5;
  --blue-soft: #5b8fc4;
  --ink: #1c1c1c;
  --muted: #5a5f6a;
  --line: #d8dde6;
  --paper: #ffffff;
  --paper-soft: #f4f6f9;
  --shadow: 0 12px 40px rgba(15, 26, 58, 0.12);
  --max: 1120px;
  --header-h: 7.5rem;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.nav-open {
  overflow: hidden;
}

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

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--navy);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.45rem;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 0 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: inherit;
}

.brand img {
  width: min(420px, 78vw);
  height: auto;
}

.brand-fallback {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.25;
}

.brand-tagline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-tagline::before,
.brand-tagline::after {
  content: "";
  width: 2.5rem;
  height: 2px;
  background: var(--blue);
}

.nav-toggle {
  display: none;
  position: absolute;
  right: 1.1rem;
  top: 1.1rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  margin: 5px auto;
  background: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  width: 100%;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.6rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.1rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--blue);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  animation: heroIn 0.9s ease both;
}

.hero-bg {
  position: absolute;
  inset: -18% 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(15, 26, 58, 0.45), rgba(15, 26, 58, 0.55)),
    url("../assets/images/hero-ponsonby.jpg") center / cover no-repeat;
  will-change: transform;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.25rem;
  max-width: 40rem;
  will-change: transform;
}

.hero h1 {
  color: #fff;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.hero p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.hero-caption {
  position: absolute;
  left: 1.25rem;
  bottom: 1rem;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.media-parallax {
  overflow: hidden;
}

.media-parallax-clip {
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.media-parallax-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  transform-origin: center center;
  will-change: transform;
  box-shadow: none;
  border-radius: 0;
}

.media-parallax .caption {
  margin-top: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.btn-ghost:hover {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--paper-soft);
}

.section-tight {
  padding: 2.75rem 0;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.split-reverse {
  grid-template-columns: 0.95fr 1.05fr;
}

.media-frame {
  position: relative;
}

.media-frame img {
  width: 100%;
  border-radius: 2px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.caption {
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--blue);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--blue);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Cards / services extras */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.offer {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.offer img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.offer .price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 2.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
}

.badge-row img {
  height: 120px;
  width: auto;
  max-width: min(180px, 28vw);
  object-fit: contain;
  filter: grayscale(0.1);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  background: #e8ecf2;
  aspect-ratio: 4 / 3;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-grid a:hover img {
  transform: scale(1.04);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 32, 0.92);
  display: none;
  place-items: center;
  z-index: 200;
  padding: 1.5rem;
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  max-height: min(88vh, 900px);
  max-width: min(94vw, 1100px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Testimonials */
.testimonials {
  position: relative;
}

.testimonial-track {
  display: grid;
  gap: 1rem;
}

.testimonial {
  background: #fff;
  border-left: 4px solid var(--blue);
  padding: 1.4rem 1.5rem;
  box-shadow: 0 4px 18px rgba(15, 26, 58, 0.06);
}

.testimonial h3 {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.testimonial .who {
  margin: 0.75rem 0 0;
  font-weight: 700;
  color: var(--navy);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-details a {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-actions {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.contact-pill {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  margin-bottom: 0 !important;
  word-break: break-word;
}

.contact-photo {
  margin-top: 1.5rem;
}

.form {
  display: grid;
  gap: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 1rem; /* keeps iOS from auto-zooming on focus */
  color: var(--ink);
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(58, 110, 165, 0.35);
  border-color: var(--blue);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fdecea;
  color: #8a1f11;
}

.alert-ok {
  background: #e8f6ee;
  color: #145a32;
}

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.86);
  padding: 2.5rem 0 2rem;
}

.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: #fff;
}

.footer-meta {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

/* Reveal motion (only when JS is active) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes heroIn {
  from {
    opacity: 0.4;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Page title band */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, #f7f9fc 0%, #eef3f9 55%, #e7eef7 100%);
}

.page-hero h1 {
  margin-bottom: 0.4rem;
}

.page-hero p {
  max-width: 40rem;
  color: var(--muted);
  margin: 0;
}

/* Thank you */
.thanks-panel {
  max-width: 40rem;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
  :root {
    --section-pad: 2.75rem;
  }

  .site-header {
    padding-top: 0;
  }

  body {
    font-size: 1rem;
  }

  .container {
    width: min(100% - 1.5rem, var(--max));
  }

  .split,
  .split-reverse,
  .contact-grid,
  .offer-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .section {
    padding: var(--section-pad) 0;
  }

  .page-hero {
    padding: 2rem 0 1.25rem;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    grid-template-areas:
      "pad brand toggle"
      "nav nav nav";
    align-items: center;
    column-gap: 0.35rem;
    row-gap: 0;
    padding: 0.85rem 0;
  }

  .brand {
    grid-area: brand;
    justify-self: center;
    align-items: center;
    text-align: center;
    max-width: 100%;
  }

  .brand img {
    width: min(240px, 58vw);
    margin-inline: auto;
  }

  .brand-tagline {
    justify-content: center;
  }

  .nav-toggle {
    grid-area: toggle;
    display: grid;
    place-content: center;
    position: static;
    width: 2.75rem;
    height: 2.75rem;
    z-index: 2;
  }

  .site-nav {
    grid-area: nav;
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.25rem 0 0.35rem;
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 2.85rem;
    padding: 0.65rem 0.15rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--blue);
  }

  .hero {
    min-height: min(62vh, 520px);
  }

  .hero-content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-caption {
    left: 1rem;
    right: 1rem;
    bottom: 0.75rem;
    font-size: 0.78rem;
  }

  .btn {
    min-height: 2.85rem;
    padding: 0.75rem 1.15rem;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row .btn {
    width: 100%;
  }

  .lead {
    font-size: 1.05rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    display: flex;
    flex-direction: column;
  }

  .contact-photo {
    margin-top: 0.5rem;
  }

  .offer {
    padding: 1.15rem;
  }

  .offer img {
    height: 180px;
  }

  .testimonial {
    padding: 1.15rem 1.1rem;
  }

  .testimonial h3 {
    font-size: 1.02rem;
  }

  .badge-row {
    gap: 1.25rem 1.5rem;
  }

  .badge-row img {
    height: 96px;
    max-width: min(140px, 28vw);
  }

  .lightbox {
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }

  .lightbox-close {
    top: max(0.65rem, env(safe-area-inset-top));
    right: max(0.65rem, env(safe-area-inset-right));
    width: 2.75rem;
    height: 2.75rem;
  }

  .thanks-panel {
    margin: 1.5rem auto;
    padding: 1rem 0.25rem 2rem;
  }

  .site-footer {
    padding: 2rem 0 1.5rem;
  }

  .footer-grid > div + div {
    padding-top: 0.35rem;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 1.25rem, var(--max));
  }

  h1 {
    font-size: clamp(1.7rem, 8.5vw, 2.2rem);
  }

  h2 {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  }

  .brand img {
    width: min(210px, 54vw);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: 70svh;
    min-height: 70vh;
  }

  .section {
    padding: 2.25rem 0;
  }

  .page-hero {
    padding: 1.35rem 0 1rem;
  }

  .badge-row img {
    height: 88px;
    max-width: min(120px, 30vw);
  }

  .media-frame img {
    box-shadow: 0 8px 24px rgba(15, 26, 58, 0.1);
  }

  /* Prefer phone/email actions; image can wait until after the form */
  .contact-photo {
    display: none;
  }
}

@media (max-width: 380px) {
  .brand img {
    width: min(180px, 50vw);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero,
  .js .reveal,
  .gallery-grid img {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-bg,
  .hero-content,
  .media-parallax-clip img,
  .badge-row {
    transform: none !important;
    will-change: auto;
  }

  .media-parallax-clip img {
    transform: none !important;
  }
}
