/* ==========================================================================
   CHUPAco — chupaco.co.uk
   Single stylesheet. Brand tokens first, then layout, then components.
   Palette lifted from the previous site so the rebrand stays continuous.
   ========================================================================== */

:root {
  /* Brand palette */
  --green:      #2F453F;   /* primary deep green */
  --green-dark: #22332E;
  --sage:       #839FA1;   /* secondary */
  --sage-light: #A6BBBC;
  --sand:       #E7DBD0;   /* warm neutral */
  --charcoal:   #3C3C3B;
  --offwhite:   #fafafa;   /* brand primary palette */
  --white:      #FFFFFF;
  --terracotta: #CD7E68;
  --clay:       #AE7354;
  --rust:       #A64E44;

  --ink:        #1F2A26;
  --ink-muted:  #5B6A64;

  /* Type.
     'Gill Sans' and 'Minion Pro' are licensed fonts used by the previous
     build. They are listed first so they are used where installed, with
     genuine fallbacks behind them rather than a bare sans-serif.
     See docs/DECISIONS.md before swapping these out. */
  --font-display: "Minion Pro", "Source Serif 4", "Source Serif Pro", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Lato, "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3:  clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem);
  --step-4:  clamp(2.2rem, 1.6rem + 2.8vw, 3.6rem);

  --wrap: 1200px;
  --wrap-narrow: 780px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);
  --radius: 4px;
  --shadow: 0 1px 2px rgba(31, 42, 38, 0.06), 0 8px 24px rgba(31, 42, 38, 0.08);
  --transition: 200ms ease;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Stop the sticky header covering anchored section headings. */
  scroll-padding-top: 6rem;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, picture, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p { margin: 0 0 1.2em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

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

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  z-index: 200;
  background: var(--green);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

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

.section { padding-block: var(--section-y); }
.section--offwhite { background: var(--offwhite); }
.section--sage     { background: var(--sage); color: var(--green-dark); }
.section--sand     { background: var(--sand); }
.section--charcoal { background: var(--charcoal); color: var(--offwhite); }

.section__title {
  font-size: var(--step-3);
  text-align: center;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}

.section__intro {
  max-width: 74ch;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  font-size: var(--step-0);
  color: inherit;
}
.section--offwhite .section__intro { color: var(--ink-muted); }

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

.btn {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9em 2em;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover, .btn:focus-visible { background: var(--sage); border-color: var(--sage); color: var(--green-dark); }

.btn--light { background: var(--white); color: var(--green); border-color: var(--white); }
.btn--light:hover, .btn--light:focus-visible { background: var(--sand); border-color: var(--sand); color: var(--green); }

.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: rgba(255,255,255,0.12); border-color: var(--white); color: var(--white); }

.btn--full { width: 100%; text-align: center; }

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

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
/* Inner pages open on a light ground, so the bar needs its own colour
   from the start rather than relying on the hero behind it. */
body.is-inner .site-header {
  position: sticky;
  background: var(--green);
}

.site-header.is-stuck {
  background: rgba(47, 69, 63, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.site-header__logo { display: block; text-decoration: none; }
.site-header__logo img {
  width: clamp(132px, 14vw, 178px);
  height: auto;
  /* The mark's own clear space is the width of the "H" — don't crowd it. */
  margin-block: 0.25rem;
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--white);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.35em;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--sand); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.6rem;
  cursor: pointer;
  color: var(--white);
}
.nav-toggle__bars { display: block; width: 26px; }
.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--green);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }
  .site-nav.is-open { max-height: 22rem; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1.5rem; }
  .site-nav li { border-bottom: 1px solid rgba(255,255,255,0.14); }
  .site-nav a { display: block; padding-block: 1rem; border-bottom: 0; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { position: relative; background: var(--green); }

.hero__media {
  min-height: clamp(20rem, 58vh, 32rem);
  /* Layered so the panel still reads as designed before brand photography
     is dropped in: photo (if present) over a tint over a brand gradient. */
  background-color: var(--green-dark);
  background-image:
    linear-gradient(rgba(34,51,46,0.55), rgba(34,51,46,0.55)),
    url('/assets/img/hero.jpg'),
    radial-gradient(120% 90% at 78% 18%, rgba(131,159,161,0.30) 0%, rgba(131,159,161,0) 60%),
    linear-gradient(155deg, #2A3E39 0%, #22332E 55%, #1B2926 100%);
  background-size: cover, cover, cover, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

.hero__panel {
  background: var(--green);
  color: var(--white);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hero__title {
  font-size: var(--step-4);
  max-width: 20ch;
  margin-inline: auto;
  margin-bottom: 0.7em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Who we work with — cards
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  /* Four cards. Column counts must divide into four, or the last card is
     orphaned on a row of its own with a card-shaped hole beside it. */
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 34rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 62rem) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}

.card__media {
  aspect-ratio: 4 / 3;
  background-color: var(--sage);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.card {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.card__title {
  font-size: var(--step-1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green);
  /* Reserve two lines so body copy lines up across the row. */
  min-height: 2.3em;
  display: flex;
  align-items: flex-end;
}

@media (max-width: 600px) {
  .card__title { min-height: 0; }
}

.card__body { color: var(--ink-muted); font-size: var(--step--1); }

/* --------------------------------------------------------------------------
   Our approach
   -------------------------------------------------------------------------- */

.approach {
  display: grid;
  /* Three steps. Never two columns — that leaves one tile alone on the second
     row and an empty cell beside it that reads as a missing fourth step. */
  grid-template-columns: 1fr;
  gap: 1px;
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(34,51,46,0.2);
}

@media (min-width: 54rem) {
  .approach { grid-template-columns: repeat(3, 1fr); }
}

.approach__step {
  position: relative;
  min-height: 24rem;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  background-color: var(--green-dark);
  overflow: hidden;
  isolation: isolate;
}

.approach__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--green-dark);
  background-size: cover;
  background-position: center;
  filter: grayscale(1) brightness(0.38) contrast(1.05);
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1), filter 400ms ease;
}
.approach__step:hover .approach__media {
  transform: scale(1.07);
  /* Lift the photograph, not the scrim — the copy must stay readable. */
  filter: grayscale(0.75) brightness(0.46) contrast(1.05);
}

.approach__step::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top,
    rgba(34,51,46,0.97) 0%,
    rgba(34,51,46,0.93) 30%,
    rgba(34,51,46,0.72) 55%,
    rgba(34,51,46,0.42) 100%);
}

.approach__content {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transform: translateY(0);
  transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.approach__step:hover .approach__content { transform: translateY(-0.4rem); }

@media (prefers-reduced-motion: reduce) {
  .approach__step:hover .approach__media { transform: none; }
  .approach__step:hover .approach__content { transform: none; }
}

.approach__number {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--sage-light);
  margin-bottom: 0.2em;
}

.approach__title {
  font-size: var(--step-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  padding-bottom: 0.35em;
  position: relative;
}
/* A rule that draws itself in on hover — the flip box's sense of response,
   without hiding anything behind it. */
.approach__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  max-width: 100%;
  height: 1px;
  background: var(--sage-light);
  transition: width 500ms cubic-bezier(0.22, 0.61, 0.36, 1), background var(--transition);
}
.approach__step:hover .approach__title::after { width: 100%; background: var(--sand); }

@media (prefers-reduced-motion: reduce) {
  .approach__step:hover .approach__title::after { width: 2.5rem; }
}

.approach__body { font-size: var(--step--1); color: rgba(255,255,255,0.92); }

/* --------------------------------------------------------------------------
   Case studies / testimonials
   -------------------------------------------------------------------------- */

.stars { color: var(--clay); letter-spacing: 0.18em; margin-bottom: 0.6em; }

/* Scroll-snap carousel. Works with no JavaScript — the track is a native
   scroll area; the arrows and dots are progressive enhancement. */
.carousel { --slide: 21rem; }

.carousel__viewport-wrap { padding-inline: 0; }

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--slide);
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  list-style: none;
  margin: 0;
  padding: 0.5rem var(--gutter) 1.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-start: var(--gutter);
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline: 3px solid var(--terracotta); outline-offset: -3px; }

.carousel__slide { scroll-snap-align: start; }

@media (min-width: 1100px) {
  .carousel { --slide: minmax(0, 1fr); }
  .carousel__track {
    grid-auto-columns: calc((100% - 2 * clamp(0.75rem, 1.5vw, 1.25rem)) / 3);
  }
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.carousel__arrow {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--green);
  background: transparent;
  border: 1px solid rgba(47, 69, 63, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.carousel__arrow:hover:not(:disabled),
.carousel__arrow:focus-visible { background: var(--green); border-color: var(--green); color: var(--white); }
.carousel__arrow:disabled { opacity: 0.3; cursor: default; }

.carousel__dots { display: flex; gap: 0.5rem; }

.carousel__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  background: rgba(47, 69, 63, 0.28);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.carousel__dot[aria-selected="true"] { background: var(--green); transform: scale(1.35); }

/* Testimonial card */
.quote {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.quote__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3em;
}

.quote__name {
  font-size: var(--step-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0;
}

.quote__source {
  flex: none;
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1;
  color: var(--sage);
}

.quote__body { margin: 0 0 1.5em; font-size: var(--step--1); color: var(--ink-muted); }
.quote__body p { margin: 0; }

.quote__link { margin: auto 0 0; }
.quote__link a {
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green);
  border-bottom: 1px solid var(--sage);
  padding-bottom: 2px;
}
.quote__link a:hover, .quote__link a:focus-visible { border-bottom-color: var(--green); }

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

.contact-form { margin-top: 1rem; }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0 1.25rem;
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  margin-bottom: 0.4em;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--white);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.7em 0.9em;
}

.field input:focus-visible,
.field textarea:focus-visible { outline-color: var(--terracotta); }

.field textarea { resize: vertical; min-height: 8rem; }

.field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field.has-error input,
.field.has-error textarea { border-color: var(--rust); }

.field__error {
  display: block;
  margin-top: 0.35em;
  font-size: var(--step--1);
  color: #F0B4AB;
}

.form-status { min-height: 1.5em; font-size: var(--step--1); }
.form-status.is-error { color: #F0B4AB; }
.form-status.is-success { color: var(--sage-light); }

/* --------------------------------------------------------------------------
   Testimonial page
   -------------------------------------------------------------------------- */

.testimonial-page { padding-top: calc(var(--section-y) + 4rem); }

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green);
  border-bottom: 1px solid transparent;
}
.back-link:hover, .back-link:focus-visible { border-bottom-color: var(--green); }

.testimonial-page__title { font-size: var(--step-3); color: var(--green); }

.testimonial-page__author {
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}
.testimonial-page__role { display: block; text-transform: none; letter-spacing: 0; }

.prose { font-size: var(--step-1); }
.prose ul { padding-left: 1.2rem; margin-bottom: 1.2em; }
.prose li { margin-bottom: 0.5em; }

.editorial-note {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.55);
  border-left: 3px solid var(--clay);
  border-radius: var(--radius);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.testimonial-page__cta { margin-top: 2.5rem; }

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

.site-footer { background: var(--white); padding-block: clamp(2rem, 4vw, 3rem); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__mark { display: block; }
/* The distilled mark is ~1.85:1, so it sits smaller than the full wordmark did. */
.site-footer__mark img { width: clamp(78px, 8vw, 98px); height: auto; }

.site-footer__social { margin: 0; font-size: var(--step--1); color: var(--ink-muted); }

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
  text-decoration: none;
}
.site-footer__social a span { border-bottom: 1px solid var(--sage); padding-bottom: 1px; }
.site-footer__social a:hover span,
.site-footer__social a:focus-visible span { border-bottom-color: var(--green); }

.icon-instagram { flex: none; transition: transform var(--transition); }
.site-footer__social a:hover .icon-instagram { transform: scale(1.1); }
