:root {
  --bg: #FAFAF8;
  --ink: #1B1F1C;
  --text: #3F4640;
  --muted: #4F5650;
  --rule: #D5D9D3;
  --field: #8C938D;
  --green: #2E6A1E;
  --serif: Alegreya, Georgia, serif;
  --sans: 'Alegreya Sans', 'Segoe UI', sans-serif;
  /* Side margin. Content sits against the left margin rather than in a centred
     column, so wide screens don't open a big empty band on the left. */
  --gutter: clamp(40px, 5vw, 96px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.45;
  /* Alegreya defaults to old-style figures; phone numbers and postal codes read better lining */
  font-variant-numeric: lining-nums;
}

/* Each page fills one screen; content is sized so it fits without scrolling
   on a desktop. Scrolling is never blocked, so zoom and phones still work. */
.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

a { color: var(--ink); }
a:hover { color: var(--green); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

h1, h2 { font-family: var(--serif); margin: 0; }
p { margin: 0; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
}

/* Header */
.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
}
.logo { display: block; }
.logo img { height: 80px; width: auto; display: block; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 36px;
  font-size: 19px;
  font-weight: 500;
}
.nav a {
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a[aria-current="page"] {
  color: var(--green);
  box-shadow: inset 0 -2px 0 var(--green);
}
.nav .login {
  gap: 8px;
  color: var(--muted);
  font-weight: 400;
  font-size: 17px;
  padding-left: 28px;
  border-left: 1px solid var(--rule);
}
.nav .login:hover { color: var(--green); }

/* Main */
main {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 96px;
}
/* Inner pages keep their content to a readable width, starting at the left margin. */
.services-main, .about-main, .contact-main { max-width: calc(1200px + 2 * var(--gutter)); }

.title {
  font-weight: 500;
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1.05;
}

.lede { color: var(--text); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.button {
  font: inherit;
  font-weight: 700;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 14px 28px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #24561A; color: #fff; }

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-underline-offset: 5px;
}

/* Footer */
.site-footer {
  padding-top: 20px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  font-size: 16px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }

/* Home */
.home .page { position: relative; z-index: 1; }
.home-main {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  padding-top: clamp(16px, 4vh, 48px);
  padding-bottom: clamp(16px, 3vh, 32px);
}
.home-copy {
  flex: 1;
  width: fit-content;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(28px, 4.5vh, 48px);
}
.home-copy h1 {
  font-weight: 500;
  font-size: clamp(40px, min(4.5vw, 7.4vh), 66px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.home-call {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}
.home-call .lede { max-width: 32ch; font-size: 21px; }

.home-services {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}
.home-services h2 { font-weight: 600; font-size: 20px; }
.home-services ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-size: 18px;
}
.home-services a {
  text-decoration: none;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}

/* The logo leaf fills the page behind the text: a 3D canvas once it has drawn, or a
   still image as a fallback. Hidden on narrower screens, where the text needs the room. */
.hero-leaf {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-leaf canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.hero-leaf img {
  position: absolute;
  height: auto;
  display: none;
}
.hero-leaf[data-state="live"] canvas { opacity: 1; }
.hero-leaf[data-state="poster"] img { display: block; }
@media (max-width: 999px) {
  .hero-leaf { display: none; }
}

/* Services */
.services-main {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 40px;
  padding-top: 24px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 28px 80px;
}
.service h2 {
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.service p { color: var(--text); }

/* About */
.portrait {
  flex: 0 1 380px;
  width: 380px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.about-text {
  flex: 999 1 460px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.about-text .role { color: var(--muted); margin-top: 4px; }
.about-text .actions { padding-top: 6px; }

/* Contact */
.contact-main { padding-bottom: 48px; }
.contact-details {
  flex: 1 1 400px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.phone {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  text-decoration: none;
  color: var(--green);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
}
.details {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 28px;
}
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.details .small { font-size: 17px; }

.contact-form {
  flex: 1 1 420px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 18px;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  font-size: 19px;
  padding: 10px 14px;
  min-height: 50px;
  border: 1px solid var(--field);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}
.contact-form .button { align-self: flex-start; padding-left: 32px; padding-right: 32px; }
.form-note { font-size: 16px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .hero-leaf canvas { transition: none; }
}

/* Phones: a short scroll is expected here. */
@media (max-width: 640px) {
  body { font-size: 18px; }
  :root { --gutter: 20px; }
  .site-header { padding-top: 16px; padding-bottom: 8px; gap: 8px; }
  .logo img { height: 60px; }
  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 0 12px;
    font-size: 17px;
  }
  .nav .login { padding-left: 12px; font-size: 16px; }
  main { padding-top: 20px; padding-bottom: 28px; gap: 36px; }
  .home-copy { gap: 32px; width: auto; }
  .home-call { align-items: stretch; }
  .home-call .lede { font-size: 19px; }
  .services-main { gap: 28px; }
  .service-grid { gap: 22px; }
  .service h2 { font-size: 23px; }
  .portrait { width: 240px; flex-basis: auto; }
  .phone { font-size: 34px; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 12px; }
  .button { width: 100%; justify-content: center; }
  .contact-form .button { align-self: stretch; }
}
