/* Johannes Tree Care — site styles
   Mobile-first. Peterson's-inspired: black/white minimal, credentials forward.
   Accent color picks up Paul's orange shirt + universal trade-safety signal. */

:root {
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --muted: #595959;
  --line: #e1e1e1;
  --paper: #ffffff;
  --paper-soft: #f5f4f1;
  --accent: #c64a1a;            /* safety-orange, slightly desaturated for print-feel */
  --accent-dark: #9a3811;
  --max: 1200px;
  --pad-x: 1.25rem;
  --radius: 2px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;        /* 17px */
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Anchor scroll offset for sticky header */
[id] { scroll-margin-top: 80px; }

/* Make main programmatically focusable for the skip-link to land in it */
main:focus { outline: none; }

/* ---- Header / nav ---- */

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

.nav {
  max-width: var(--max); margin: 0 auto;
  padding: 0.875rem var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.01em;
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  line-height: 1.15;
}
.brand span { white-space: nowrap; }
.brand b { color: var(--accent-dark); font-weight: 700; }
.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

@media (min-width: 720px) {
  .brand { font-size: 1.125rem; }
  .brand small { font-size: 0.75rem; }
}

.nav-toggle {
  appearance: none; background: transparent; border: 1px solid var(--line);
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--radius);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav-links {
  display: none;
}

.nav-links.is-open {
  display: flex; flex-direction: column;
  position: fixed;
  top: var(--header-h, 64px);
  left: 0; right: 0; bottom: 0;
  background: var(--paper);
  padding: 1.5rem var(--pad-x) calc(2rem + env(safe-area-inset-bottom));
  gap: 0.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-links a {
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.875rem 0.25rem;
  border-bottom: 1px solid var(--line);
  display: block;
  min-height: 44px;
}
.nav-links a[aria-current="page"] { color: var(--accent); }

.nav-links .cta {
  margin-top: 0.75rem;
  border: none;
  background: var(--accent);
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  font-weight: 600;
}
.nav-links .cta:hover { background: var(--accent-dark); }

@media (min-width: 880px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex; flex-direction: row; align-items: center; gap: 1.25rem;
    position: static; padding: 0; background: transparent;
  }
  .nav-links a {
    padding: 0.375rem 0;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
  }
  .nav-links .cta {
    margin-top: 0;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
  }
}

/* ---- Hero ---- */

.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  min-height: 60vh;
  display: flex; align-items: flex-end;
}
@media (min-width: 720px) {
  .hero { min-height: 70vh; }
}
@media (min-width: 1024px) {
  .hero { min-height: 78vh; max-height: 760px; }
}

.hero-image {
  position: absolute; inset: 0;
  background-color: #111;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* Plain url() fallback for older browsers — set first so image-set wins where supported */
  background-image: url("photos/hero-aerial-1600.jpg");
  background-image: -webkit-image-set(
    url("photos/hero-aerial-800.jpg") 1x,
    url("photos/hero-aerial-1600.jpg") 2x
  );
  background-image: image-set(
    url("photos/hero-aerial-800.jpg") 1x,
    url("photos/hero-aerial-1600.jpg") 2x
  );
}
@media (min-width: 720px) {
  .hero-image {
    background-image: url("photos/hero-aerial-2400.jpg");
    background-image: -webkit-image-set(
      url("photos/hero-aerial-1600.jpg") 1x,
      url("photos/hero-aerial-2400.jpg") 2x
    );
    background-image: image-set(
      url("photos/hero-aerial-1600.jpg") 1x,
      url("photos/hero-aerial-2400.jpg") 2x
    );
  }
}

.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 35%, rgba(0,0,0,.85) 100%);
}

.hero-content {
  position: relative; z-index: 2;
  max-width: var(--max); margin: 0 auto;
  padding: 2rem var(--pad-x) 2.25rem;
  width: 100%;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #fff;
}

.hero-lede {
  margin: 0 0 1.5rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.45;
  max-width: 38em;
  color: rgba(255,255,255,.92);
}

.credentials {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem;
  margin: 0 0 1.5rem;
  list-style: none; padding: 0;
}
.credentials li {
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--radius);
  color: #fff; background: rgba(0,0,0,.7);
}
.credentials-ink li {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600; font-size: 1rem;
  border: none; cursor: pointer;
  min-height: 48px;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
}
.btn-ghost:hover { background: #fff; color: var(--ink); }

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

/* ---- Layout helpers ---- */

.section {
  padding: 3rem var(--pad-x);
}
.section > .inner {
  max-width: var(--max); margin: 0 auto;
}
.inner-narrow { max-width: 720px !important; }
.section-alt { background: var(--paper-soft); }

.aside-block { margin-top: 2.5rem; }
.aside-block h2 {
  font-size: 1.125rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.aside-block p { margin: 0; color: var(--muted); }

@media (min-width: 720px) {
  .section { padding: 4.5rem var(--pad-x); }
}

.section h1, .section h2 {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.section h1 {
  font-size: clamp(1.875rem, 3.6vw, 2.5rem);
}
.section .eyebrow, .eyebrow {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 0.5rem;
}
.section .lede {
  font-size: 1.0625rem; color: var(--muted);
  max-width: 42em; margin: 0 0 2rem;
}

/* ---- Services grid ---- */

.services-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

.service-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.service-card img {
  width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; object-position: center;
}
.service-card-body { padding: 1.25rem 1.25rem 1.5rem; }
.service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem; font-weight: 700; color: var(--ink);
}
.service-card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* ---- Team / about ---- */

.team {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 760px) {
  .team { grid-template-columns: 1fr 1.25fr; gap: 3rem; }
  .team-image-right { grid-template-columns: 1.25fr 1fr; }
  .team-image-right > .bio { order: 1; }
  .team-image-right > img { order: 2; }
}
.team img { border-radius: var(--radius); }
.team .bio p { margin: 0 0 1rem; }
.team .bio .eyebrow { font-size: 0.75rem; }
.team .bio h1, .team .bio h2 {
  margin-top: 0;
  font-size: clamp(1.875rem, 3.6vw, 2.5rem);
  line-height: 1.15; letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

/* ---- Gallery ---- */

.gallery-grid {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  padding: 0; margin: 0;
}
@media (min-width: 600px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.gallery-grid li { list-style: none; margin: 0; padding: 0; }
.gallery-grid a {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--paper-soft);
}
@media (min-width: 600px) {
  .gallery-grid a { aspect-ratio: 4 / 5; }
}
.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.gallery-grid a:hover img { transform: scale(1.04); }

/* ---- Form ---- */

.form-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem var(--pad-x);
  box-shadow: var(--shadow-card);
}
@media (min-width: 720px) { .form-card { padding: 2.5rem 2.5rem; } }

.form-row { margin-bottom: 1.25rem; }
.form-row label {
  display: block; font-weight: 600; color: var(--ink);
  font-size: 0.9375rem; margin-bottom: 0.375rem;
}
.form-row label .req { color: var(--accent); }
.form-row .hint { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }
.form-row input, .form-row textarea {
  width: 100%;
  font: inherit;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.form-actions .btn { width: 100%; padding: 1rem 1.5rem; font-size: 1.0625rem; }
@media (min-width: 600px) {
  .form-actions { flex-direction: row; align-items: center; }
  .form-actions .btn { width: auto; }
}

.form-success, .form-error {
  padding: 1rem 1.25rem; border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.form-success { background: #ecf6ec; border: 1px solid #b8d9b8; color: #1d521d; }
.form-error { background: #fdecec; border: 1px solid #ebbcbc; color: #7b1d1d; }
[hidden] { display: none !important; }

.field-error {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #9c2424;
  font-weight: 500;
}
[aria-invalid="true"] {
  border-color: #9c2424 !important;
  box-shadow: 0 0 0 1px #9c2424;
}

/* ---- Contact strip / footer ---- */

.contact-strip {
  background: var(--ink); color: #fff;
  padding: 2rem var(--pad-x);
  text-align: center;
}
.contact-strip h2 { color: #fff; margin: 0 0 0.5rem; font-size: 1.5rem; }
.contact-strip p { color: rgba(255,255,255,.85); margin: 0 0 1.25rem; }
.contact-strip .btn { background: var(--accent); }
.contact-strip .btn:hover { background: var(--accent-dark); }

.site-footer {
  background: #1a1a1a; color: rgba(255,255,255,.7);
  padding: 2.5rem var(--pad-x) 2rem;
  font-size: 0.875rem;
}
.site-footer .inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: 1.5rem;
}
@media (min-width: 720px) {
  .site-footer .inner { grid-template-columns: 1.25fr 1fr 1fr; gap: 3rem; }
}
.site-footer h3 {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #fff; margin: 0 0 0.75rem;
}
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 0.5rem; }
.site-footer .tagline {
  font-style: italic; color: rgba(255,255,255,.55);
  font-size: 0.875rem; margin-top: 0.75rem;
}
.site-footer .legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.5rem; margin-top: 1.5rem;
  text-align: center; font-size: 0.8125rem; color: rgba(255,255,255,.5);
  grid-column: 1 / -1;
}

/* ---- Misc ---- */

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff;
  padding: 0.75rem 1rem; z-index: 100;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus, .skip-link:focus-visible {
  left: 0.5rem; top: 0.5rem;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  color: #fff;
}

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

.tel-link { white-space: nowrap; }

/* For prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
