/* ============================================
   Allister Grew Building
   Nelson, New Zealand
   Design system and global styles.
   Edit the tokens in :root; everything else follows.
   ============================================ */

/* Metric-adjusted fallbacks so the webfont swap is nearly invisible */
@font-face {
  font-family: 'Serif Fallback';
  src: local('Georgia'), local('Times New Roman');
  size-adjust: 96%;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Sans Fallback';
  src: local('Helvetica Neue'), local('Helvetica'), local('Arial');
  size-adjust: 97%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  /* Surfaces and ink. Warm neutrals pulled from the cedar and concrete
     in Allister's own photos; the red is the existing brand red. */
  --color-bg:          #FBFAF8;
  --color-bg-alt:      #F1EEE9;
  --color-surface:     #FFFFFF;
  --color-ink:         #17181A;
  --color-ink-soft:    #4B4E54;
  --color-muted:       #85888F;
  --color-rule:        rgba(23, 24, 26, 0.12);
  --color-rule-strong: rgba(23, 24, 26, 0.22);
  --color-accent:      #C40D04;
  --color-accent-deep: #9E0A03;

  --font-serif: 'Fraunces', 'Serif Fallback', Georgia, serif;
  --font-sans:  'Archivo', 'Sans Fallback', 'Helvetica Neue', Arial, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6.5rem;

  --maxw-content:  1140px;
  --maxw-prose:    660px;
  --maxw-headline: 880px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-pill: 999px;
}

/* ============================================
   Reset and base
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  color: var(--color-ink-soft);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-ink); text-decoration: none; transition: color 0.15s ease, opacity 0.15s ease; }
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-ink);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.25; }
h4 { font-size: 1.0625rem; letter-spacing: 0; }
p  { margin: 0 0 var(--space-2); }
p:last-child { margin-bottom: 0; }

strong { color: var(--color-ink); font-weight: 600; }

::selection { background: var(--color-accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================
   Layout helpers
   ============================================ */

.container {
  width: 100%;
  max-width: var(--maxw-content);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container--narrow   { max-width: var(--maxw-prose); }
.container--headline { max-width: var(--maxw-headline); }

.section { padding: var(--space-6) 0; }
.section--tight { padding: var(--space-5) 0; }
.section--alt  { background: var(--color-bg-alt); }
.section--dark { background: var(--color-ink); color: color-mix(in srgb, var(--color-bg) 78%, transparent); }
.section--dark h2, .section--dark h3 { color: var(--color-bg); }
.section--dark .eyebrow { color: color-mix(in srgb, var(--color-bg) 55%, transparent); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
  font-weight: 600;
}

.lede { font-size: 1.125rem; color: var(--color-ink-soft); }

.section__head { max-width: var(--maxw-headline); margin: 0 0 var(--space-5); }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

/* ============================================
   Header / navigation
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  border-bottom: 1px solid var(--color-rule);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: var(--maxw-content);
  margin: 0 auto;
  padding: 0.875rem var(--space-3);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-ink);
  line-height: 1;
}
.nav__logo:hover { color: var(--color-ink); }
.nav__logo svg { width: 34px; height: auto; flex: none; }

.nav__logo-text { display: flex; flex-direction: column; gap: 0.14em; }

.nav__logo-mark {
  font-family: var(--font-sans);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  line-height: 1;
}

.nav__logo-sub {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
  line-height: 1;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-ink-soft);
}
.nav__links a:hover { color: var(--color-accent); }
.nav__links a[aria-current="page"] { color: var(--color-ink); }

.nav__cta {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav__cta:hover { background: var(--color-accent-deep); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: -0.5rem;
  color: var(--color-ink);
}
.nav__toggle svg { display: block; }

/* ============================================
   Hero
   ============================================ */

.hero {
  position: relative;
  color: #fff;
  isolation: isolate;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: flex-end;
  padding: var(--space-7) 0 var(--space-6);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }

/* Two overlapping washes: a vertical one for the copy block at the bottom,
   and a left-weighted one so the text stays legible over bright sky. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(15,16,18,0.72) 0%, rgba(15,16,18,0.34) 52%, rgba(15,16,18,0.10) 100%),
    linear-gradient(180deg, rgba(15,16,18,0.34) 0%, rgba(15,16,18,0.30) 38%, rgba(15,16,18,0.86) 100%);
}

/* Wide enough that the headline breaks on a phrase boundary rather than
   orphaning "and outdoor" onto its own line at desktop widths. */
.hero__inner { max-width: 880px; }

.hero__location {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

.hero__title { color: #fff; margin-bottom: var(--space-3); }

.hero__subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.90);
  max-width: 560px;
  margin: 0 0 var(--space-4);
}

.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Interior page header */
.page-header {
  background: var(--color-ink);
  color: color-mix(in srgb, var(--color-bg) 75%, transparent);
  padding: var(--space-6) 0 var(--space-5);
}
.page-header h1 { color: var(--color-bg); margin-bottom: var(--space-2); }
.page-header .eyebrow { color: color-mix(in srgb, var(--color-bg) 60%, transparent); }
.page-header p { font-size: 1.0625rem; max-width: 620px; }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  line-height: 1;
}
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn--primary:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); color: #fff; }

.btn--dark { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.btn--dark:hover { background: transparent; color: var(--color-ink); }

.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-rule-strong); }
.btn--ghost:hover { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-bg); }

.btn--light { background: rgba(255,255,255,0.10); color: #fff; border-color: rgba(255,255,255,0.55); backdrop-filter: blur(4px); }
.btn--light:hover { background: #fff; color: var(--color-ink); border-color: #fff; }

.btn--onred { background: #fff; color: var(--color-accent-deep); border-color: #fff; }
.btn--onred:hover { background: transparent; color: #fff; border-color: #fff; }

/* ============================================
   Service cards
   ============================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-3);
}

/* Five cards on a three-column grid leave a hole in the second row.
   A six-track grid lets the last two cards split the full width instead. */
@media (min-width: 940px) {
  .services-grid--five {
    grid-template-columns: repeat(6, 1fr);
  }
  .services-grid--five > * { grid-column: span 2; }
  .services-grid--five > :nth-child(4) { grid-column: span 3; }
  .services-grid--five > :nth-child(5) { grid-column: span 3; }
  .services-grid--five > :nth-child(4) .service-card__media img,
  .services-grid--five > :nth-child(5) .service-card__media img { height: 230px; }
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.service-card:hover {
  border-color: var(--color-rule-strong);
  box-shadow: 0 10px 34px rgba(23,24,26,0.10);
  transform: translateY(-3px);
}

.service-card__media { background: var(--color-bg-alt); }
.service-card__media img { width: 100%; height: 190px; object-fit: cover; object-position: center; }

/* Crops chosen per photograph, not applied blind: each one keeps the subject
   in frame at card height. */
.service-card__media--low img  { object-position: center 78%; }
.service-card__media--high img { object-position: center 30%; }

/* Cards with no photograph get a typographic panel instead of filler stock */
.service-card__plate {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, var(--color-ink) 0%, #24262A 100%);
  color: rgba(255,255,255,0.9);
}
.service-card__plate svg { width: 54px; height: auto; opacity: 0.9; }

.service-card__body { padding: var(--space-3); display: flex; flex-direction: column; flex: 1; }
.service-card__body h3 { margin-bottom: 0.5rem; }
.service-card__body p { font-size: 0.9375rem; margin-bottom: 0; }

.service-card__link {
  margin-top: var(--space-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.service-card__link::after { content: '\2192'; transition: transform 0.18s ease; }
.service-card:hover .service-card__link::after { transform: translateX(3px); }

.service-card__stretch { position: absolute; inset: 0; }

/* ============================================
   Split blocks (image + text)
   ============================================ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split--narrow-media { grid-template-columns: 0.85fr 1fr; }
.split__media img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.split__body > :last-child { margin-bottom: 0; }

.split + .split { margin-top: var(--space-6); }
.split--reverse .split__media { order: 2; }

/* ============================================
   Detail rows on the services page
   ============================================ */

.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-rule);
}
.detail:first-of-type { border-top: 0; padding-top: 0; }
.detail__media img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.detail--reverse .detail__media { order: 2; }

/* ============================================
   Pill tags
   ============================================ */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: var(--space-3) 0 0;
  list-style: none;
}
.tag-list li {
  padding: 0.4rem 0.95rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-ink-soft);
}
.section--alt .tag-list li { background: var(--color-surface); }

/* ============================================
   Testimonial
   ============================================ */

.testimonial { max-width: 720px; margin: 0 auto; text-align: center; }

.testimonial__stars {
  display: inline-flex;
  gap: 0.2rem;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}
.testimonial__stars svg { width: 20px; height: 20px; }
.section--dark .testimonial__stars { color: #FDB900; }

.testimonial__quote {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.7vw, 1.75rem);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
}
.section--dark .testimonial__quote { color: var(--color-bg); }
.testimonial__quote::before { content: '\201C'; }
.testimonial__quote::after  { content: '\201D'; }

.testimonial__attribution {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-muted);
  margin: 0;
}
.section--dark .testimonial__attribution { color: color-mix(in srgb, var(--color-bg) 62%, transparent); }

/* ============================================
   Stat strip
   ============================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.stats li {
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
}
.stats__figure {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-ink);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.stats__label { font-size: 0.9375rem; margin: 0; }

/* ============================================
   Red call-to-action band
   ============================================ */

.cta-band {
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-6) 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.92); font-size: 1.0625rem; }

.cta-band__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.cta-band__text { max-width: 620px; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ============================================
   Contact page blocks
   ============================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-rule);
}
.contact-list li:first-child { padding-top: 0; }
.contact-list li:last-child { border-bottom: 0; }

.contact-list__label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}
.contact-list__value {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.contact-list__value a { color: var(--color-ink); }
.contact-list__value a:hover { color: var(--color-accent); }
.contact-list__note { font-size: 0.9375rem; margin: 0.35rem 0 0; }

.map-frame {
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
}
.map-frame iframe { display: block; width: 100%; height: 420px; border: 0; }

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.section--alt .panel { background: var(--color-surface); }

/* ============================================
   Prose (privacy, careers)
   ============================================ */

/* Left-aligned to the page container, with a comfortable reading measure.
   Not .container--narrow: that centres the block and leaves it out of
   alignment with the left-aligned page header above it. */
/* Cap the children, not the block: the wrapper keeps the page container's
   width and padding, so prose lines up with the page header above it. */
.prose > * { max-width: 720px; }
.prose h2 { margin-top: var(--space-5); font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.15rem; margin: 0 0 var(--space-2); }
.prose li { margin-bottom: 0.4rem; }
/* Inline links only. Without :not(.btn) this beats .btn--primary on
   specificity and paints button labels red on red. */
.prose a:not(.btn) { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.prose .btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--space-3); }

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--color-ink);
  color: color-mix(in srgb, var(--color-bg) 72%, transparent);
  padding: var(--space-6) 0 var(--space-3);
}
.site-footer a { color: color-mix(in srgb, var(--color-bg) 88%, transparent); }
.site-footer a:hover { color: #fff; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--color-bg) 16%, transparent);
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-bg);
  margin: 0 0 var(--space-2);
  line-height: 1;
}
.footer__logo svg { width: 36px; height: auto; flex: none; }
.footer__logo-text { display: flex; flex-direction: column; gap: 0.16em; }
.footer__logo-mark {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1;
}
.footer__logo-sub {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-bg) 55%, transparent);
  line-height: 1;
}

.footer__tagline { font-size: 0.9375rem; max-width: 320px; margin: 0; }

.footer__heading {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-bg) 55%, transparent);
  margin: 0 0 var(--space-2);
}

.footer__nav, .footer__contact { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; }
.footer__nav li, .footer__contact li { padding: 0.28rem 0; }

.footer__legal {
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: color-mix(in srgb, var(--color-bg) 60%, transparent);
}
.footer__legal a { color: color-mix(in srgb, var(--color-bg) 70%, transparent); }

/* ============================================
   Accessibility
   ============================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .split, .split--narrow-media, .detail { grid-template-columns: 1fr; }
  .split--reverse .split__media, .detail--reverse .detail__media { order: 0; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --space-6: 3.25rem; --space-7: 4.5rem; }

  .nav__toggle { display: block; }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-rule);
    padding: var(--space-1) 0 var(--space-2);
    display: none;
    box-shadow: 0 12px 30px rgba(23,24,26,0.10);
  }
  .nav__links.is-open { display: flex; }
  .nav__links li { padding: 0.65rem var(--space-3); border-bottom: 1px solid var(--color-rule); }
  .nav__links li:last-child { border-bottom: 0; padding-top: var(--space-2); }
  .nav__cta { display: block; text-align: center; }

  .hero { min-height: 0; padding: var(--space-6) 0 var(--space-5); }
  .hero__ctas .btn { flex: 1 1 auto; }

  .footer__grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer__legal { justify-content: center; text-align: center; }

  .cta-band__inner { flex-direction: column; align-items: flex-start; }
  .map-frame iframe { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
