/* Kingsfield Contracting — shared styles */

:root {
  --ink: #0e1012;
  --char: #17191c;
  --char-2: #202328;
  --line: rgba(255, 255, 255, 0.12);
  --paper: #f4f2ed;
  --paper-2: #e9e6df;
  --text: #1b1d20;
  --muted: #5d6167;
  --white: #ffffff;
  --red: #c8102e;      /* trailer trim red */
  --amber: #f2a900;    /* machine / gritter yellow */
  --ice: #6cc3ff;      /* winter accent */
  --accent: var(--amber);

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

.theme-winter { --accent: var(--ice); }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); }
h2 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.section-light .eyebrow { color: var(--red); }
.theme-winter .section-light .eyebrow { color: #1677c4; }

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

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  color: var(--white);
}
.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
}
.brand-sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 2px solid var(--red);
  width: 100%;
  text-align: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: inherit;
  border-radius: var(--radius);
  padding: 8px 12px;
  font: 600 0.95rem var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: var(--gutter);
    right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--char);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
}

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

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost:hover { border-color: var(--white); }

/* ---------- Season split (home) ---------- */

.split {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ink);
}
.split-panel {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: flex 0.5s ease;
}
.split-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.8s ease;
}
.split-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(8, 9, 10, 0.92) 0%, rgba(8, 9, 10, 0.45) 45%, rgba(8, 9, 10, 0.35) 100%);
}
.split-panel.agri { --accent: var(--amber); border-right: 3px solid var(--red); }
.split-panel.winter { --accent: var(--ice); }
.split-panel.in-season { flex: 1.3; }
.split-panel:hover img { transform: scale(1.04); }

.split-body {
  padding: 0 clamp(20px, 4vw, 56px) clamp(40px, 8vh, 80px);
  max-width: 560px;
}
.split-body .eyebrow { display: block; }
.split-body h2 { font-size: clamp(2.4rem, 4.6vw, 4.2rem); margin-bottom: 0.25em; }
.split-body p { color: rgba(255, 255, 255, 0.82); margin-bottom: 1.5rem; }
.split-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.split-list li {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
}
.split-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.split-cta span { display: inline-block; transition: transform 0.2s ease; }
.split-panel:hover .split-cta span { transform: translateX(6px); }

.season-badge {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--accent);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 1rem;
}
.season-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.6s ease-in-out infinite;
}
.in-season .season-badge { display: inline-flex; }

@keyframes pulse { 50% { opacity: 0.25; } }

@media (max-width: 820px) {
  .split { flex-direction: column; }
  .split-panel { min-height: 78vh; min-height: 78svh; }
  .split-panel.agri { border-right: 0; border-bottom: 3px solid var(--red); }
  .split-panel:first-child .split-body { padding-top: 110px; }
}

/* ---------- Page hero ---------- */

.hero {
  position: relative;
  min-height: 82vh;
  min-height: 82svh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  background: var(--ink);
  isolation: isolate;
}
.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(8, 9, 10, 0.94) 5%, rgba(8, 9, 10, 0.35) 60%, rgba(8, 9, 10, 0.5) 100%);
}
.hero .wrap { padding-top: 130px; padding-bottom: clamp(48px, 9vh, 96px); }
.hero-short { min-height: 56vh; min-height: 56svh; }
.hero-short .wrap { padding-top: 140px; }
.hero h1 { max-width: 18ch; }
.hero p.lead {
  font-size: 1.2rem;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.season-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 2rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}
.season-switch a { color: var(--white); font-weight: 600; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-dark { background: var(--char); color: var(--white); }
.section-ink { background: var(--ink); color: var(--white); }
.section-light { background: var(--paper); }

.section-head { max-width: 720px; margin-bottom: 3rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-dark .section-head p, .section-ink .section-head p { color: rgba(255, 255, 255, 0.72); }

/* Strip of key facts */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.fact {
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--line);
}
.fact + .fact { padding-left: 24px; }
.fact:last-child { border-right: 0; }
.fact strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 6px;
}
.fact span { font-size: 0.95rem; color: rgba(255, 255, 255, 0.72); }
@media (max-width: 820px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact { padding: 22px 16px; border-bottom: 1px solid var(--line); }
  .fact + .fact { padding-left: 16px; }
  .fact:nth-child(2n) { border-right: 0; }
}

/* Two-column story */
.story {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.story-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.story-media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
}
.story-media img:nth-child(2) { margin-top: 48px; }
.story p { color: var(--muted); font-size: 1.08rem; }
@media (max-width: 820px) {
  .story { grid-template-columns: 1fr; }
}

/* Service cards */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service {
  background: var(--char);
  padding: 28px 24px;
}
.section-light .services { background: var(--paper-2); border-color: var(--paper-2); }
.section-light .service { background: var(--white); }
.service-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.section-light .service-num { color: var(--red); }
.theme-winter .section-light .service-num { color: #1677c4; }
.service h3 { margin: 10px 0 6px; font-size: 1.45rem; }
.service-more {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
}
.section-light .service-more { background: var(--char); color: var(--white); }
.section-light .service.service-more p { color: rgba(255, 255, 255, 0.72); }
.service-more .split-cta { margin-top: 12px; color: var(--amber); }
@media (max-width: 600px) { .service-more { grid-column: auto; } }
.service p { margin: 0; font-size: 0.98rem; color: rgba(255, 255, 255, 0.68); }
.section-light .service p { color: var(--muted); }

/* Feature band: image + list */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
.feature-media { position: relative; min-height: 360px; }
.feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature-body {
  padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-body p { color: rgba(255, 255, 255, 0.75); }
.tick-list { list-style: none; padding: 0; margin: 1rem 0 2rem; }
.tick-list li {
  position: relative;
  padding: 12px 0 12px 32px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; }
  .feature.reverse .feature-media { order: -1; }
}

/* Sector chips (winter) */
.sectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.sector {
  background: var(--white);
  border-left: 4px solid var(--ice);
  padding: 18px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Gallery */
.gallery {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 8px;
}
.gallery button {
  padding: 0;
  border: 0;
  background: var(--char-2);
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--radius);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}
.gallery button:hover img { transform: scale(1.05); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }
@media (max-width: 820px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 7, 0.94);
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  border-radius: var(--radius);
  font: 600 0.95rem var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 6vw, 80px);
}
.contact-details { list-style: none; padding: 0; margin: 2rem 0 0; }
.contact-details li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.contact-details small {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.contact-details a, .contact-details span {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
.contact-details a:hover { color: var(--accent); }

.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.form input, .form select, .form textarea {
  width: 100%;
  font: 400 1rem var(--font-body);
  color: var(--white);
  background: var(--char-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.form textarea { min-height: 130px; resize: vertical; }
.form .btn { justify-self: start; }
.form .btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.h-captcha { min-height: 78px; }
.form-status {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: var(--char-2);
  font-weight: 500;
}
.form-status.error { border-left-color: var(--red); }
@media (max-width: 820px) {
  .contact { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Call-to-action band */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18ch; margin-left: auto; margin-right: auto; }
.cta-band p { color: rgba(255, 255, 255, 0.72); font-size: 1.15rem; max-width: 52ch; margin: 0 auto 2rem; }
.cta-band .hero-actions { justify-content: center; }

/* Home: link cards to every page */
.page-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.page-link {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 320px;
  padding: 24px;
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}
.page-link img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.6s ease;
}
.page-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(8, 9, 10, 0.9), rgba(8, 9, 10, 0.1));
}
.page-link:hover img { transform: scale(1.05); }
.page-link h3 { font-size: 2rem; margin-bottom: 4px; }
.page-link p { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.98rem; }
.page-link.agri { --accent: var(--amber); }
.page-link.winter { --accent: var(--ice); }
.page-link .split-cta { display: block; margin-top: 10px; font-size: 1rem; }
@media (max-width: 820px) {
  .page-links { grid-template-columns: 1fr; }
  .page-link { min-height: 240px; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.92rem;
  padding: 40px 0;
  border-top: 3px solid var(--red);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-footer .brand { color: var(--white); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.footer-legal { flex-basis: 100%; margin: 0; font-size: 0.85rem; }

/* Privacy page */
.legal { max-width: 800px; }
.legal h2 { font-size: 1.9rem; margin-top: 2.2rem; }
.legal li { margin-bottom: 0.5em; }

.form-note { margin: 0; font-size: 0.9rem; color: rgba(255, 255, 255, 0.65); }

/* ---------- Mobile call bar (added by main.js) ---------- */

.call-bar { display: none; }

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  body { font-size: 16px; padding-bottom: 64px; }

  .brand-name { font-size: 1.6rem; }

  .split-panel { min-height: 70vh; min-height: 70svh; }

  /* Darker overlay so text stays readable over busy photos */
  .hero::before, .split-panel::before {
    background: linear-gradient(to top, rgba(8, 9, 10, 0.95) 10%, rgba(8, 9, 10, 0.6) 60%, rgba(8, 9, 10, 0.55) 100%);
  }
  .hero p.lead { font-size: 1.08rem; }

  /* Full-width, easy-to-tap buttons */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn, .feature-body .btn, .form .btn { width: 100%; text-align: center; }
  .form .btn { justify-self: stretch; }

  .season-switch { display: block; line-height: 1.7; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 2rem; }

  .contact-details a, .contact-details span { font-size: 1.1rem; overflow-wrap: anywhere; }

  .footer-links { gap: 12px 18px; }

  .call-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--ink);
    border-top: 3px solid var(--red);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .call-bar a {
    flex: 1;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 11px 8px;
    border-radius: var(--radius);
  }
  .call-bar .call { background: var(--accent); color: var(--ink); }
  .call-bar .quote { border: 2px solid rgba(255, 255, 255, 0.4); color: var(--white); }
}

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
