/* ==========================================================================
   Kingswood Man & Digger Hire — kingswoodmananddiggerhire.co.uk
   Built by Michael Dunn, mykd.co.uk
   Derived from the "Modernist" design system exported from Claude Design.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  /* Brand orange-red, sampled from the Hitachi digger. Decorative use only. */
  --color-accent: #e8500f;
  /* Text/button orange. A touch deeper so 14px text and white-on-orange both
     clear WCAG AA (4.5:1). Visually all but identical to the brand accent. */
  --color-accent-ink: #c14206;
  --color-accent-600: #ae3703;
  --color-accent-700: #ae3703;
  --color-accent-800: #8a2b02;
  --color-accent-100: #fff4ee;
  --color-neutral-100: #f8f4f4;
  --color-neutral-800: #444141;
  --color-divider: rgba(32, 30, 29, 0.4);
  --color-dark: #231a14;
  --color-dark-text: #f6efe7;

  --font-heading: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading-weight: 800;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius: 5px;
  --radius-lg: 14px;

  --wrap: 1440px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(40px, 6vw, 80px);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* stop anchor targets hiding behind the sticky header */
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

p { margin: 0 0 var(--space-3); }
/* height:auto is load-bearing: without it the HTML height attribute wins
   over aspect-ratio and the gallery crops break. */
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(236, 48, 19, 0.3); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--space-2); top: -60px; z-index: 100;
  background: var(--color-accent); color: #fff;
  padding: 10px 18px; border-radius: var(--radius);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-2); color: #fff; }

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--gutter);
}

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

.kicker {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

.lede {
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 48ch;
  color: rgba(32, 30, 29, 0.82);
}

.lede--areas { margin-bottom: var(--space-6); }

.hr { height: 2px; border: 0; margin: 0; background: var(--color-divider); }

/* Two-column split used by the service, areas and contact sections */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.split--areas { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr); }
.split--contact { grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr); align-items: start; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 14px 30px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent-ink); color: #fff; }
.btn-primary:hover { background: var(--color-accent-600); color: #fff; }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: rgba(32, 30, 29, 0.07); }
.btn-block { width: 100%; }
.btn-on-dark {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* --------------------------------------------------------------------------
   5. Tags
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 4px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent-ink); color: var(--color-accent-ink); }

/* --------------------------------------------------------------------------
   6. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-dark);
  color: var(--color-dark-text);
}
.site-header .wrap {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 96px;
}

.nav-brand {
  display: flex; flex-direction: column; gap: 2px;
  line-height: 1; text-decoration: none;
  color: var(--color-dark-text);
  margin-right: auto;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
}
.nav-brand__name { font-size: 22px; letter-spacing: 0.01em; }
.nav-brand__strap {
  font-size: 11px; font-weight: 400; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(246, 239, 231, 0.65);
}

.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a {
  color: var(--color-dark-text);
  text-decoration: none;
  font-size: 14px;
}
.nav-links a:hover { color: #ff9a63; }
.nav-links .btn-primary { color: #fff; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid rgba(246, 239, 231, 0.35);
  border-radius: var(--radius); color: var(--color-dark-text);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 20px; height: 2px;
  background: currentColor; margin: 0 auto; content: "";
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 580px;
  display: flex; align-items: center;
  background-color: #1c120a;
  background-image:
    linear-gradient(100deg, rgba(28, 18, 10, 0.62) 0%, rgba(28, 18, 10, 0.34) 55%, rgba(28, 18, 10, 0.22) 100%),
    linear-gradient(180deg, rgba(28, 18, 10, 0.18), rgba(28, 18, 10, 0.42)),
    url("../img/hero-digger.jpg");
  background-position: center 55%;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
}
.hero .wrap { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.hero__kicker {
  display: block; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #ff9a63; margin-bottom: var(--space-4);
}
.hero__title {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.06; letter-spacing: -0.02em;
  margin: 0 0 20px; color: #fff; max-width: 20ch;
}
.hero__lede {
  font-size: 17px; line-height: 1.6; max-width: 46ch;
  margin: 0 0 28px; color: rgba(255, 255, 255, 0.9);
}
.hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   8. Service list
   -------------------------------------------------------------------------- */
.section--service { background: #f4eeec; }
.service-figure { border-radius: var(--radius-lg); overflow: hidden; order: 2; }
.service-figure img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.service-copy { order: 1; }
.service-copy .lede { margin: 0 0 28px; }

.service-list { margin: 0; padding: 0; list-style: none; }
.service-list li {
  display: grid; grid-template-columns: 32px 1fr;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) 0;
  border-top: 2px solid var(--color-divider);
}
.service-list li:last-child { border-bottom: 2px solid var(--color-divider); }
.service-list__num {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; color: var(--color-accent-ink);
}
.service-list strong { font-size: 15px; }
.service-list p {
  margin: var(--space-1) 0 0; font-size: 14px;
  color: rgba(32, 30, 29, 0.78);
}

/* --------------------------------------------------------------------------
   9. Areas covered
   -------------------------------------------------------------------------- */
.areas-card {
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: clamp(20px, 3vw, 32px);
  display: grid; gap: var(--space-4);
}
.areas-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; background: var(--color-divider);
}
.areas-grid > div {
  background: var(--color-bg); padding: clamp(18px, 2.4vw, 26px) 20px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 120px;
}
.areas-grid strong {
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1; letter-spacing: -0.015em;
}
.areas-note {
  margin: 0; font-size: 13px; letter-spacing: 0.02em;
  color: rgba(32, 30, 29, 0.65);
}
.tag-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   10. Gallery
   -------------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
}
.gallery figure > div { overflow: hidden; border-radius: var(--radius-lg); }
.gallery img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--color-surface);
}
.gallery figcaption {
  margin-top: 10px; font-size: 13px;
  color: rgba(32, 30, 29, 0.7);
}
.gallery figcaption .tag { margin-right: var(--space-2); }

/* --------------------------------------------------------------------------
   11. Contact
   -------------------------------------------------------------------------- */
.section--contact { background: var(--color-accent-ink); color: var(--color-bg); }
.section--contact .kicker { color: rgba(243, 242, 242, 0.95); }
.section--contact .section-title {
  color: var(--color-bg);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.1;
}
.section--contact .lede { color: rgba(243, 242, 242, 0.95); max-width: 44ch; margin: 0 0 var(--space-6); }
.contact-detail { margin: 0 0 6px; font-size: 15px; }
.contact-detail a { color: var(--color-bg); }
.contact-detail a:hover { color: #fff; }
.contact-detail--muted { margin: 0; color: rgba(243, 242, 242, 0.95); }
.contact-detail--muted strong { color: var(--color-bg); }

.contact-form {
  background: var(--color-bg); color: var(--color-text);
  padding: clamp(20px, 3vw, 28px);
  display: grid; gap: var(--space-4);
  border-radius: var(--radius);
}
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: rgba(32, 30, 29, 0.7);
}
.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}
.input:hover { border-color: rgba(32, 30, 29, 0.45); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 110px; resize: vertical; }

/* honeypot — hidden from people, visible to naive bots */
.hp-field {
  position: absolute; left: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}

.form-status { margin: 0; font-size: 14px; }
.form-status--error { color: var(--color-accent-800); font-weight: 600; }
.form-success { padding: var(--space-6) 0; text-align: center; }
.form-success strong { font-family: var(--font-heading); font-size: 17px; }
.form-success p { margin: var(--space-2) 0 0; font-size: 14px; color: rgba(32, 30, 29, 0.78); }
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 2px solid var(--color-divider); }
.site-footer .wrap {
  padding-top: var(--space-6); padding-bottom: var(--space-6);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2);
  font-size: 13px; color: rgba(32, 30, 29, 0.65);
}
.site-footer a { color: inherit; }

/* --------------------------------------------------------------------------
   13. Error page
   -------------------------------------------------------------------------- */
.error-page {
  min-height: 60vh; display: grid; place-items: center;
  text-align: center; padding: var(--section-y) var(--gutter);
}

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .split,
  .split--areas,
  .split--contact { grid-template-columns: minmax(0, 1fr); }
  .service-figure { order: 1; }
  .service-copy { order: 2; }
  .hero { min-height: 480px; }
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .site-header .wrap { min-height: 76px; flex-wrap: wrap; }
  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: var(--space-4);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 14px 0;
    border-top: 1px solid rgba(246, 239, 231, 0.18);
    font-size: 16px;
  }
  .nav-links .btn-primary {
    margin-top: var(--space-3);
    border-top: 0;
    justify-content: center;
  }
  html { scroll-padding-top: 84px; }
}

@media (max-width: 520px) {
  .hero { min-height: 440px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .areas-grid { grid-template-columns: 1fr; }
  .site-footer .wrap { flex-direction: column; }
}

@media print {
  .site-header, .nav-toggle, .contact-form, .hero__actions { display: none; }
  body { background: #fff; }
}
