:root {
  --ink: #171717;
  --muted: #5f5f5f;
  --paper: #f4f1ea;
  --surface: #ffffff;
  --line: #d8d2c7;
  --accent: #c9161d;
  --accent-dark: #151515;
  --rust: #c9161d;
  --shadow: 0 20px 70px rgb(0 0 0 / 16%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 55%), rgb(244 241 234 / 100%)),
    var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgb(0 0 0 / 10%);
  background: rgb(244 241 234 / 92%);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.hero-actions,
.contact-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: clamp(190px, 18vw, 270px);
  height: auto;
}

.nav-links {
  gap: clamp(14px, 3vw, 32px);
  color: #505050;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--accent);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(780px, calc(100vh - 70px));
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  background-image: url("assets/hero-tractor.jpg");
  background-position: center right;
  background-size: cover;
  transform: scale(1.02);
  z-index: -2;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgb(0 0 0 / 86%) 0%, rgb(0 0 0 / 68%) 42%, rgb(0 0 0 / 20%) 74%, rgb(0 0 0 / 8%) 100%),
    linear-gradient(180deg, rgb(0 0 0 / 12%) 0%, rgb(0 0 0 / 34%) 100%);
  z-index: -1;
}

.hero-content {
  width: min(820px, 100%);
  padding: clamp(74px, 11vw, 138px) clamp(20px, 6vw, 76px) clamp(82px, 10vw, 124px);
  align-self: center;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  overflow-wrap: normal;
  word-break: normal;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.55rem, 6vw, 5.35rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: rgb(255 255 255 / 84%);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 13px 18px;
  font-weight: 750;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.button.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 34px rgb(0 0 0 / 24%);
}

.button.primary:hover {
  background: #a91016;
}

.button.secondary {
  border-color: rgb(255 255 255 / 34%);
  color: #fff;
  background: rgb(255 255 255 / 10%);
  backdrop-filter: blur(8px);
}

.section,
.contact-band {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: clamp(58px, 8vw, 96px) 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 6vw, 78px);
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.intro p:last-child {
  margin: 36px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-card {
  min-height: 250px;
  padding: 26px;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 10px 34px rgb(0 0 0 / 7%);
}

.service-number {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--rust);
  font-weight: 850;
}

.service-card p {
  margin: 16px 0 0;
  color: var(--muted);
}

.portfolio-section {
  border-top: 1px solid var(--line);
}

.portfolio-heading {
  max-width: 760px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-card {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 6px;
  padding: 0;
  aspect-ratio: 4 / 3;
  background: #ded8cf;
  cursor: zoom-in;
}

.portfolio-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.portfolio-card:hover img,
.portfolio-card:focus-visible img {
  filter: contrast(1.04) saturate(1.03);
  transform: scale(1.035);
}

.portfolio-card:focus-visible {
  outline: 3px solid rgb(201 22 29 / 42%);
  outline-offset: 3px;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 28px;
  align-items: center;
  margin-bottom: clamp(42px, 7vw, 82px);
  padding: clamp(28px, 5vw, 54px);
  border-radius: 6px;
  color: #fff8ec;
  background:
    linear-gradient(135deg, rgb(21 21 21 / 98%), rgb(54 54 54 / 94%)),
    var(--accent-dark);
  box-shadow: var(--shadow);
}

.contact-band p {
  max-width: 680px;
  margin: 18px 0 0;
  color: rgb(255 248 236 / 76%);
}

.contact-band .section-label {
  color: #ff666b;
}

.contact-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  justify-self: end;
}

.contact-actions .primary {
  background: #fff;
  color: #171717;
  box-shadow: none;
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background: rgb(0 0 0 / 88%);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  display: block;
  max-width: min(1180px, 100%);
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 44%);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 6px;
  color: #fff;
  background: rgb(0 0 0 / 48%);
  cursor: pointer;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 820px) {
  .site-header {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

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

  .brand-logo {
    width: min(260px, 72vw);
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px clamp(18px, 5vw, 30px);
  }

  .hero {
    min-height: auto;
  }

  .hero-media {
    background-position: 64% center;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgb(0 0 0 / 78%) 0%, rgb(0 0 0 / 64%) 56%, rgb(0 0 0 / 82%) 100%),
      linear-gradient(90deg, rgb(0 0 0 / 72%) 0%, rgb(0 0 0 / 32%) 100%);
  }

  .hero-content {
    padding-top: 76px;
  }

  .intro,
  .service-grid,
  .portfolio-grid,
  .contact-band {
    grid-template-columns: 1fr;
  }

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

  .intro p:last-child {
    margin-top: 0;
  }

  .contact-actions {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .nav-links {
    gap: 10px 18px;
  }

  .hero-actions,
  .button,
  .contact-actions {
    width: 100%;
  }

  .button {
    padding-right: 14px;
    padding-left: 14px;
  }

  .service-card {
    min-height: 220px;
  }

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

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .site-header {
    align-items: center;
    flex-direction: row;
    text-align: left;
  }

  .brand {
    width: auto;
    justify-content: flex-start;
  }

  .brand-logo {
    width: clamp(180px, 24vw, 250px);
  }

  .nav-links {
    width: auto;
    justify-content: flex-end;
    gap: clamp(12px, 2.6vw, 26px);
  }
}
