/* Havilah Partners
   A conventional developer site: full-bleed photography under a fixed header,
   then alternating cream and sandstone sections laid out as a side head in a
   left column with the content to its right, closing on a charcoal contact band. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/fonts/libre-baskerville.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/fonts/libre-baskerville-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette (fixed by the brief) */
  --cream: #F5F1E8;
  --charcoal: #1C1B18;
  --gold: #B58A3A;
  --sandstone: #E4D9C5;
  --soft: #34322E;

  /* Hairlines, mixed from the palette */
  --rule: color-mix(in srgb, var(--charcoal) 16%, var(--cream));
  --rule-sand: color-mix(in srgb, var(--charcoal) 18%, var(--sandstone));
  --rule-dark: color-mix(in srgb, var(--cream) 18%, var(--charcoal));

  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Libre Baskerville", Baskerville, Georgia, serif;
  --font-label: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --max: 80rem;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --header-h: 5.5rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
  scrollbar-color: color-mix(in srgb, var(--soft) 55%, var(--sandstone)) var(--sandstone);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, blockquote, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

::selection { background: var(--gold); color: var(--charcoal); }

/* Focus follows the text colour, so it stays visible on cream, sandstone and charcoal alike */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.nowrap { white-space: nowrap; }

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

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--cream);
  color: var(--charcoal);
  font: 600 .75rem/1 var(--font-label);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--cream);
  /* Transparent over the hero: the photo's own top edge is burned darker for legibility */
  border-bottom: 1px solid color-mix(in srgb, var(--cream) 22%, transparent);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.site-header.is-solid {
  background: var(--cream);
  color: var(--charcoal);
  border-bottom-color: var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: var(--header-h);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.75rem, 3vw, 2.75rem);
}
.site-nav__link {
  position: relative;
  display: inline-block;
  padding-block: .65rem;
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav__link:not(.site-nav__link--button)::after {
  content: "";
  position: absolute;
  left: 0; right: .18em; bottom: .25rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .45s var(--ease-out);
}
.site-nav__link:hover::after,
.site-nav__link[aria-current="true"]::after { transform: scaleX(1); }

.site-nav__link--button {
  padding: .95rem 1.5rem;
  border: 1px solid currentColor;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.site-nav__link--button:hover,
.site-nav__link--button[aria-current="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--charcoal);
}

.menu-toggle { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  min-height: 3.4rem;
  padding: 0 1.85rem;
  border: 1px solid transparent;
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.btn__arrow,
.contact__arrow {
  width: 1.15rem;
  height: .7rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform .3s var(--ease-out);
}
.btn:hover .btn__arrow,
.contact__email:hover .contact__arrow { transform: translateX(4px); }

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--charcoal);
}
.btn--gold:hover {
  background: var(--cream);
  border-color: var(--cream);
}
.btn--ghost {
  color: var(--cream);
  border-color: color-mix(in srgb, var(--cream) 60%, transparent);
}
.btn--ghost:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--charcoal);
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: max(40rem, 100svh);
  color: var(--cream);
  background: var(--charcoal);
}
.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 62%;
}
/* Flat charcoal scrim for legibility */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--charcoal) 45%, transparent);
}

.hero__content {
  align-self: center;
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 3rem;
}
.hero__title {
  max-width: 9.6em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 1.5rem + 5vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero__lede {
  max-width: 34em;
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
  font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem);
  line-height: 1.75;
  color: color-mix(in srgb, var(--cream) 92%, transparent);
  text-wrap: pretty;
}
.hero__lede::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin-bottom: clamp(1.75rem, 3vw, 2.25rem);
  background: var(--gold);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.hero__sectors { padding-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.sectors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid color-mix(in srgb, var(--cream) 28%, transparent);
}
.sectors li {
  padding-top: 1.25rem;
  font-family: var(--font-label);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 88%, transparent);
}

/* The hero copy settles into place once; it is visible from the first frame */
@media (prefers-reduced-motion: no-preference) {
  .hero__content > * { animation: settle 1.1s var(--ease-out) both; }
  .hero__lede { animation-delay: .08s; }
  .hero__actions { animation-delay: .16s; }
}
@keyframes settle {
  from { transform: translateY(14px); }
  to   { transform: none; }
}

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

.section { padding-block: clamp(5rem, 9vw, 8.5rem); }
.section--cream { background: var(--cream); }
.section--sand { background: var(--sandstone); }

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 2.25rem;
}
.split__body { grid-column: 4 / -1; min-width: 0; }

/* Section names sit in their own left column, never stacked over a headline */
.side-head {
  grid-column: 1 / span 3;
  padding-top: .55rem;
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--soft);
}
.side-head::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-bottom: 1.1rem;
  background: var(--gold);
}
.side-head--dark { color: var(--sandstone); }

.statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 1.4rem + 2.8vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  color: var(--charcoal);
}
.statement span { display: block; }
.statement--md { font-size: clamp(2.2rem, 1.3rem + 2.2vw, 3.5rem); }

.prose { max-width: 38em; color: var(--soft); }
.prose p { text-wrap: pretty; }
.prose p + p { margin-top: 1.1em; }
.prose--lead {
  max-width: 60ch;
  margin-top: clamp(2.25rem, 4vw, 3.5rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--rule);
}
.lead-para {
  font-size: clamp(1.2rem, 1.05rem + .5vw, 1.4rem);
  line-height: 1.65;
  color: var(--charcoal);
}

/* Meaning */
.meaning {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.meaning__text .prose { margin-top: clamp(1.75rem, 3vw, 2.5rem); }
.meaning__image { aspect-ratio: 4 / 5; overflow: hidden; background: var(--charcoal); }
.meaning__image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }

/* Scripture band */
.quote-band {
  padding-block: clamp(5rem, 9vw, 8rem);
  background: var(--charcoal);
  color: var(--cream);
  text-align: center;
}
.quote-band__inner::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin: 0 auto clamp(2rem, 3.5vw, 2.75rem);
  background: var(--gold);
}
.quote-band__text p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.1rem, 1.2rem + 3vw, 4rem);
  line-height: 1.12;
  text-wrap: balance;
}
.quote-band__cite {
  margin-top: clamp(1.5rem, 2.6vw, 2rem);
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* What we do */
.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.service__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sandstone);
}
.service__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.service:hover .service__media img { transform: scale(1.035); }
.service__title {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 1.25rem + 1vw, 2.15rem);
  line-height: 1.12;
}
.service__text {
  max-width: 30em;
  margin-top: .85rem;
  color: var(--soft);
  text-wrap: pretty;
}

/* Approach */
.approach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.approach__steps {
  display: grid;
  border-bottom: 1px solid var(--rule-sand);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.5rem + 3.4vw, 5rem);
  line-height: 1;
  letter-spacing: -.01em;
}
.approach__step {
  display: block;
  padding-block: clamp(.9rem, 1.6vw, 1.25rem);
  border-top: 1px solid var(--rule-sand);
}
/* Shares the steps' first hairline, so both columns start on one line */
.approach__text {
  max-width: 52ch;
  padding-top: clamp(1.25rem, 2vw, 1.6rem);
  border-top: 1px solid var(--rule-sand);
  font-size: clamp(1.05rem, 1rem + .2vw, 1.15rem);
  line-height: 1.75;
  color: var(--soft);
  text-wrap: pretty;
}

/* Contact */
.contact {
  padding-block: clamp(5.5rem, 10vw, 9rem);
  background: var(--charcoal);
  color: var(--cream);
}
.contact__body { display: grid; gap: clamp(2.25rem, 4vw, 3.25rem); }
.contact__title {
  max-width: 11em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.4rem + 3.8vw, 5rem);
  line-height: 1.04;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.contact__action {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--rule-dark);
}
.contact__note { max-width: 26em; color: var(--sandstone); }
.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 1rem + 1.7vw, 2.5rem);
  line-height: 1.2;
  text-decoration-line: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
  overflow-wrap: anywhere;
  transition: text-decoration-thickness .25s ease;
}
.contact__email:hover { text-decoration-thickness: 2px; }

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

.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
  background: var(--charcoal);
  color: var(--sandstone);
  border-top: 1px solid var(--rule-dark);
}
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 2rem 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule-dark);
}
.wordmark--footer { color: var(--cream); font-size: 1.15rem; }
.site-footer__line {
  margin-top: 1.1rem;
  font-family: var(--font-label);
  font-size: .7rem;
  font-weight: 600;
  line-height: 2;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.site-footer__line .sep { padding-inline: .5em; color: var(--gold); }
.site-footer__break { display: none; }
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2.25rem;
}
.site-footer__nav a {
  font-family: var(--font-label);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
}
.site-footer__nav a[href^="mailto:"] {
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.site-footer__nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: .35em;
}
.site-footer__legal { margin-top: 1.75rem; font-size: .8rem; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav__link::after,
  .site-nav__link--button,
  .btn,
  .btn__arrow,
  .contact__arrow,
  .contact__email,
  .menu-toggle__icon span,
  .service__media img { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .split { row-gap: clamp(2.75rem, 7vw, 3.75rem); }
  .split__body { grid-column: 1 / -1; }

  /* Below the side-head column, the section name becomes a running head on a full-width rule */
  .side-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-top: 0;
  }
  .side-head::before {
    order: 2;
    flex: 1 1 auto;
    width: auto;
    height: 1px;
    margin: 0;
    background: var(--rule);
  }
  .section--sand .side-head::before { background: var(--rule-sand); }
  .side-head--dark::before { background: var(--rule-dark); }

  .approach { grid-template-columns: 1fr; }
  /* The running head's rule opens the list, and the list's last rule closes it */
  .approach__step:first-child { border-top: 0; padding-top: 0; }
  .approach__text { padding-top: 0; border-top: 0; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sectors { grid-template-columns: repeat(4, max-content); column-gap: 2.5rem; }
  .sectors li { white-space: nowrap; }
}

@media (max-width: 767px) {
  :root { --header-h: 4.5rem; }

  .wordmark { font-size: 1.05rem; letter-spacing: .24em; }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: 600 .72rem/1 var(--font-label);
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .menu-toggle__icon {
    display: grid;
    gap: 6px;
    width: 1.4rem;
  }
  .menu-toggle__icon span {
    display: block;
    height: 1.5px;
    background: currentColor;
    transition: transform .3s var(--ease-out);
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: .5rem var(--pad) 1.75rem;
    background: var(--cream);
    color: var(--charcoal);
    border-bottom: 1px solid var(--rule);
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__link {
    display: block;
    padding-block: 1.1rem;
    border-bottom: 1px solid var(--rule);
    font-size: .8rem;
  }
  .site-nav__link:not(.site-nav__link--button)::after { display: none; }
  .site-nav__link--button {
    margin-top: 1.5rem;
    border: 1px solid var(--gold);
    background: var(--gold);
    text-align: center;
  }

  .hero { min-height: max(36rem, 100svh); }
  .hero__image { object-position: 42% 62%; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .sectors {
    grid-template-columns: repeat(2, max-content);
    column-gap: 2rem;
    row-gap: .25rem;
  }
  .sectors li {
    padding-top: 1rem;
    font-size: .7rem;
    letter-spacing: .16em;
    white-space: nowrap;
  }
  .sectors li:nth-child(n + 3) { padding-top: .5rem; }

  .meaning { grid-template-columns: 1fr; }
  .meaning__image { aspect-ratio: 3 / 2; }

  .services { grid-template-columns: 1fr; row-gap: 3.5rem; }

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

  .site-footer__break { display: inline; }
  .site-footer__break + .nowrap .sep { display: none; }
}

@media (max-width: 359px) {
  .site-footer__line .sep,
  .site-footer__break { display: none; }
  .site-footer__line .nowrap { display: block; }
}
