:root {
  --bg: #fbfcf9;
  --sidebar: #eef5ec;
  --surface: #ffffff;
  --text: #243028;
  --muted: #5c685f;
  --green: #315a3d;
  --lime: #6f9f1f;
  --lime-dark: #557f17;
  --border: #d9e4d7;
  --dark: #243528;
  --sidebar-width: 272px;
  --rail-space: 1.7rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  background: #fff;
  color: #000;
  padding: 0.75rem 1rem;
  border: 2px solid #000;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
}

.sidebar-upper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rail-space);
}

.brand-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

.brand-link {
  display: inline-block;
  text-decoration: none;
}

.brand-logo {
  width: min(100%, 210px);
  height: auto;
}

.sidebar-rule {
  width: 44px;
  height: 2px;
  background: var(--lime);
  opacity: 0.45;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-nav a {
  position: relative;
  width: fit-content;
  color: var(--lime);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: color 180ms ease, transform 180ms ease;
}

.sidebar-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
  color: var(--lime-dark);
  transform: translateY(-1px);
}

.sidebar-nav a:hover::after,
.sidebar-nav a:focus::after {
  transform: scaleX(1);
}

.sidebar-meta {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sidebar-meta p {
  margin: 0.12rem 0;
}

.sidebar-meta-title {
  color: var(--green);
  font-weight: 700;
  margin-bottom: 0.45rem !important;
}

.sidebar-contact {
  padding-top: var(--rail-space);
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.sidebar-contact p {
  margin: 0 0 0.45rem;
}

.sidebar-contact a {
  color: var(--lime);
  font-weight: 700;
  text-decoration: none;
}

.sidebar-contact a:hover,
.sidebar-contact a:focus {
  color: var(--lime-dark);
  text-decoration: underline;
}

.site-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.masthead {
  position: relative;
  min-height: 395px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #fbfcf9;
}

.masthead-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 20px;
  width: calc(100% - 20px);
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.masthead-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 20px;
  width: calc(100% - 20px);
  background: linear-gradient(
    90deg,
    rgba(251, 252, 249, 0.22) 0%,
    rgba(251, 252, 249, 0.12) 30%,
    rgba(251, 252, 249, 0.04) 56%,
    rgba(251, 252, 249, 0.00) 100%
  );
}

.masthead-copy {
  position: relative;
  z-index: 2;
  padding: 2.2rem clamp(2rem, 5vw, 5.5rem);
  max-width: 730px;
  transform: translateY(-0.4rem);
}

.kicker,
.section-label {
  margin: 0 0 0.7rem;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.masthead h1 {
  margin: 0;
  max-width: 620px;
  color: var(--green);
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.cairn-note {
  max-width: 440px;
  margin-top: 1.45rem;
  padding-left: 1rem;
  border-left: 3px solid var(--lime);
  color: var(--green);
}

.cairn-note p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 600;
}

.section {
  padding: 4.25rem clamp(2rem, 5vw, 5.5rem);
  scroll-margin-top: 32px;
}

.services {
  background: var(--surface);
}

.service-list {
  border-top: 1px solid var(--border);
}

.service-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.service-number {
  color: var(--lime);
  font-size: 0.95rem;
  font-weight: 700;
}

.service-row h2,
.split-section h2,
.experience-copy h2,
.contact-section h2 {
  margin: 0;
  color: var(--green);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.2;
}

.service-row p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4rem;
  background: #f1f6ef;
}

.copy-block {
  align-self: center;
}

.copy-block p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.experience-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  background: var(--bg);
}

.experience-copy {
  max-width: 760px;
}

.inline-link {
  display: inline-block;
  margin-top: 1.2rem;
  color: var(--lime);
  font-weight: 700;
  text-decoration: none;
}

.inline-link:hover,
.inline-link:focus {
  color: var(--lime-dark);
  text-decoration: underline;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.2rem clamp(2rem, 5vw, 5.5rem);
  background: var(--dark);
  color: #fff;
  scroll-margin-top: 32px;
}

.section-label.light {
  color: #b7d96c;
}

.contact-section h2 {
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.contact-section p {
  margin: 0.55rem 0 0;
  color: rgba(255,255,255,0.78);
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.contact-button {
  display: inline-block;
  padding: 0.72rem 1.05rem;
  border-radius: 999px;
  background: var(--lime);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.contact-button:hover,
.contact-button:focus {
  background: var(--lime-dark);
}

.contact-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus {
  text-decoration: underline;
}

.site-footer {
  padding: 0.55rem 1.4rem 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.site-footer p {
  margin: 0;
  text-align: right;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.section:target,
.contact-section:target {
  animation: reveal 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes reveal {
  from {
    opacity: 0.45;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 100%;
  }

  html {
    scroll-padding-top: 112px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 0.9rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .sidebar-upper {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
  }

  .brand-block {
    width: auto;
  }

  .brand-logo {
    width: 150px;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 0.8rem;
    margin-left: auto;
    flex-wrap: wrap;
  }

  .sidebar-rule,
  .sidebar-meta,
  .sidebar-contact {
    display: none;
  }

  .site-main {
    margin-left: 0;
  }

  .section,
  .contact-section {
    scroll-margin-top: 112px;
  }

  .masthead {
    min-height: 390px;
  }

  .masthead-image,
  .masthead-overlay {
    left: 0;
    width: 100%;
  }

  .split-section,
  .experience-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 650px) {
  .sidebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar-upper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .brand-logo {
    width: 165px;
  }

  .sidebar-nav {
    margin-left: 0;
    justify-content: flex-start;
  }

  .masthead {
    min-height: 360px;
    background: #fbfcf9;
  }

  .masthead-image {
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right center;
  }

  .masthead-overlay {
    left: 0;
    width: 100%;
    background: rgba(251, 252, 249, 0.35);
  }

  .masthead-copy {
    padding: 2.2rem 1.25rem;
    transform: none;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .service-row {
    grid-template-columns: 52px 1fr;
  }

  .contact-section {
    align-items: flex-start;
    flex-direction: column;
    padding: 2.6rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section:target,
  .contact-section:target {
    animation: none;
  }

  .sidebar-nav a,
  .sidebar-nav a::after {
    transition: none;
  }
}
