/* ==========================================================================
   Herbert Weddings — site styles
   --------------------------------------------------------------------------
   Authored mobile-first. Base rules are the phone case; breakpoints scale the
   TOKENS (--page-pad, --section-gap ...) rather than re-declaring rules, so the
   desktop composition from the handoff falls out of a handful of media queries.

   Contents
     1. Tokens
     2. Reset & base
     3. Typography primitives
     4. Layout primitives
     5. Header & lockup
     6. Sections
     7. Footer
     8. Utilities & motion
   ========================================================================== */


/* 1. Tokens ================================================================ */

:root {
  /* Colour — three surface tiers, one accent, one secondary. Never #FFFFFF:
     clinical white reads budget-tier and breaks the warmth. */
  --near-white: #FDFBF6;  /* raised surface: cards, panels. Also the ONLY type
                             colour used on a forest ground. */
  --ivory:      #F6F1E7;  /* page base */
  --stone:      #E4DCCF;  /* recessed surface: bands that sit back */
  --ink:        #2B2824;  /* all body copy and headings on light surfaces */
  --forest:     #2E4A3C;  /* the single accent: links, labels, the closing band */
  --deep-stone: #C2B6A2;  /* dividers and hairlines. Never type, never fills. */

  /* Type */
  --font-display: Fraunces, Georgia, "Times New Roman", serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout — these are what the breakpoints below actually move. */
  --page-max: 1360px;
  --page-pad: 24px;
  --section-gap: 84px;   /* vertical rhythm between sections */
  --band-pad: 72px;      /* vertical padding inside banded sections */
  --split-gap: 40px;     /* label column -> content column */
  --band-stack: 36px;    /* label -> content inside a band */

  /* Header */
  --header-pad-y: 16px;
  --lockup-size: 18px;

  /* Small-caps labels. Sized above the handoff's 11px: at 11px with 0.26em
     tracking the labels read as too small and too fine on real screens. */
  --eyebrow-size: 13px;
  --eyebrow-track: 0.2em;

  /* Motion — restrained only, <=200ms. */
  --t: 180ms ease;
}

@media (min-width: 48em) {          /* 768px */
  :root {
    --page-pad: 40px;
    --section-gap: 112px;
    --band-pad: 88px;
    --split-gap: 56px;
    --band-stack: 44px;
    --header-pad-y: 22px;
    --lockup-size: 21px;
  }
}

@media (min-width: 64em) {          /* 1024px */
  :root {
    --page-pad: 56px;
    --section-gap: 136px;
    --band-pad: 104px;
    --split-gap: 88px;
    --band-stack: 52px;
    --header-pad-y: 26px;
    --lockup-size: 23px;
  }
}


/* 2. Reset & base ========================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;   /* keep in-page targets clear of the fixed header */
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;           /* Inter 300/400 only. Never 500 or above. */
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 48em) { body { font-size: 17px; } }

h1, h2, h3, p, figure, ol { margin: 0; }
ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
/* The width/height HTML attributes are presentational hints that map to the
   width/height CSS properties. Without `height: auto` a CSS `width` plus an
   HTML `height` attribute leaves both dimensions definite, and `aspect-ratio`
   is silently ignored. Elements that need a real height override this. */
img { height: auto; }

::selection { background: var(--stone); }

/* Links: define both states — undefined links render browser-default blue. */
a {
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid var(--deep-stone);
  transition: color var(--t), border-color var(--t);
}
a:hover { color: var(--ink); border-bottom-color: var(--forest); }

:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* On dark grounds a forest outline disappears; flip it to ivory. */
.hero :focus-visible,
.closing :focus-visible,
.site-header--overlay:not(.is-scrolled) :focus-visible { outline-color: var(--near-white); }

.skip-link {
  position: absolute;
  top: 0; left: 0;
  z-index: 40;
  transform: translateY(-120%);
  padding: 12px 20px;
  background: var(--near-white);
  border: 1px solid var(--deep-stone);
  font-size: 14px;
}
.skip-link:focus-visible { transform: translateY(0); }


/* 3. Typography primitives ================================================= */

/* Fraunces, with the optical-size axis exposed as a custom property so each
   level can set its own: opsz 48 under ~30px, 60 for 30-44px, 96 above that. */
.display {
  font-family: var(--font-display);
  font-weight: 450;
  font-variation-settings: 'opsz' var(--opsz, 96), 'SOFT' 0, 'WONK' 0;
}

/* Opens most sections. Marked up as a heading, sized as a label. */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--eyebrow-size);
  line-height: 1.4;
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--forest);
}


/* 4. Layout primitives ===================================================== */

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* Vertical rhythm: every section after the first gets one gap.
   Matched on the ELEMENT, not the .section class — .hero is a <section> that
   deliberately carries no .section class, and a class-based sibling selector
   silently skipped the hero -> first-section gap. */
main > section + section { margin-block-start: var(--section-gap); }

/* Label column + content column.
   minmax(150px, 0.28fr) rather than a bare 0.28fr: bare fr tracks refuse to
   shrink below min-content and cause horizontal overflow at narrow widths. */
.split { display: grid; gap: var(--split-gap); align-items: start; }
@media (min-width: 62em) {
  .split { grid-template-columns: minmax(150px, 0.28fr) minmax(0, 0.72fr); }
}
.split__body { max-width: 52ch; }

/* Hairline separators without borders: a 2px gap over a deep-stone ground.
   Explicit column counts rather than auto-fit: auto-fit would give three cards
   a two-column row at tablet widths, and the leftover EMPTY cell renders the
   deep-stone ground as a solid block instead of a hairline. */
.hairline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  background: var(--deep-stone);
}
@media (min-width: 48em) {
  .hairline-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* 5. Header & lockup ======================================================= */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  isolation: isolate;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: calc(var(--header-pad-y) - 6px) var(--page-pad);
  background-color: var(--ivory);
  border-bottom: 1px solid var(--deep-stone);
  color: var(--ink);
  transition: background-color var(--t), color var(--t),
              border-color var(--t), padding var(--t);
}

/* The scrim over the hero lives on a pseudo-element so the state change can
   fade it; a background-image cannot transition to a background-colour. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(180deg, rgb(43 40 36 / 0.42), rgb(43 40 36 / 0));
  transition: opacity var(--t);
}

/* Solid is the DEFAULT above, so a page with no hero renders correctly with no
   JavaScript at all. Only a page that actually has a hero opts into the
   transparent overlay, and scrolling past the hero simply drops the opt-in. */
.site-header--overlay:not(.is-scrolled) {
  padding-block: var(--header-pad-y);
  background-color: rgb(246 241 231 / 0);
  border-bottom-color: transparent;
  color: var(--near-white);
}
.site-header--overlay:not(.is-scrolled)::before { opacity: 1; }

.site-header__email {
  position: relative;
  flex: none;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: inherit;
  border-bottom-color: var(--deep-stone);
}
/* Hit area only — real padding here would push the header past the 26px/20px
   block padding the handoff specifies. */
.site-header__email::after {
  content: "";
  position: absolute;
  inset: -12px -6px;
}
.site-header--overlay:not(.is-scrolled) .site-header__email { border-bottom-color: rgb(253 251 246 / 0.5); }
.site-header__email:hover { color: inherit; }

/* Lockup: quill mark and wordmark on one baseline. */
.lockup {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: calc(var(--lockup-size) * 0.6);   /* ~= the width of the H */
  color: inherit;
  border-bottom: none;
}
.lockup__word {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: 'opsz' 96, 'SOFT' 0, 'WONK' 0;
  font-size: var(--lockup-size);
  line-height: 1;
  letter-spacing: 0.002em;
  transition: font-size var(--t);
}
/* Mark ink height equals the cap height of the H (~0.72 x font-size). */
.lockup__mark {
  height: calc(var(--lockup-size) * 0.72);
  width: auto;
  overflow: visible;
  stroke-width: 1.25;           /* stroke compensation: heavier at small sizes */
}
@media (min-width: 48em) { .lockup__mark { stroke-width: 1.1; } }

.site-header .lockup__word { font-size: calc(var(--lockup-size) - 2px); }
.site-header .lockup__mark { stroke-width: 1; }
.site-header--overlay:not(.is-scrolled) .lockup__word { font-size: var(--lockup-size); }
.site-header--overlay:not(.is-scrolled) .lockup__mark { stroke-width: 1.1; }

/* The lockup renders ~21px tall, well under the 44px tap target the handoff
   asks for. A transparent positioned pseudo-element enlarges the anchor's hit
   region without changing the header's layout or height. */
.lockup::after {
  content: "";
  position: absolute;
  inset: -13px -8px;
}

.lockup--footer { --lockup-size: 20px; }
.lockup--footer .lockup__mark { stroke-width: 1; }


/* 6. Sections ============================================================== */

/* --- S01 Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* svh rather than vh so the hero does not jump as mobile browser chrome
     collapses on scroll. */
  min-height: min(880px, max(100svh, 660px));
}

/* Invisible 90px marker the header observes; see assets/js/header.js. */
.hero__sentinel {
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 90px;
  pointer-events: none;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
}

/* All hero type is --near-white; this scrim is what holds AA over the
   photograph. Do not tint the type down to stone instead. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgb(43 40 36 / 0.46)  0%,
    rgb(43 40 36 / 0.30) 22%,
    rgb(43 40 36 / 0.62) 46%,
    rgb(43 40 36 / 0.80) 70%,
    rgb(43 40 36 / 0.86) 100%);
}

.hero__content {
  position: relative;
  padding-block: 116px 56px;
  color: var(--near-white);
}
@media (min-width: 48em) { .hero__content { padding-block: 150px 64px; } }
@media (min-width: 64em) { .hero__content { padding-block: 170px 72px; } }

.hero__headline {
  max-width: 26ch;
  font-size: clamp(40px, 6.2vw, 86px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.hero__band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 28px;
  align-items: start;
  margin-block-start: clamp(32px, 5vw, 56px);
  padding-block-start: clamp(22px, 3vw, 30px);
  border-top: 1px solid rgb(253 251 246 / 0.42);
}
@media (min-width: 48em) { .hero__band { gap: 44px; } }

.hero__band .eyebrow { color: var(--near-white); }
.hero__lead { max-width: 32ch; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.55; }
.hero__venues { font-size: clamp(16px, 1.3vw, 18px); line-height: 1.7; }

/* --- S02 Statement ------------------------------------------------------- */
.statement {
  --opsz: 60;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.statement__support {
  margin-block-start: clamp(24px, 3vw, 34px);
  max-width: 56ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.68;
}

/* --- S03 Three-up cards on a stone band ---------------------------------- */
.band--stone {
  background: var(--stone);
  border-block: 1px solid var(--deep-stone);
}
.band__inner {
  display: flex;
  flex-direction: column;
  gap: var(--band-stack);
  padding-block: var(--band-pad) calc(var(--band-pad) + 8px);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--near-white);
  padding: 30px 24px 34px;
}
@media (min-width: 48em) { .card { padding: 36px 32px 40px; } }

.card__index {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--forest);
}
.card__title {
  --opsz: 48;
  font-size: clamp(23px, 2vw, 26px);
  line-height: 1.15;
}
.card__body { font-size: 16px; line-height: 1.65; }

/* --- Three-up figure row -------------------------------------------------- */
/* Sits inside .container, so it stops at the page max-width. Explicit column
   counts (1 or 3, never 2) so the deep-stone ground only ever shows through
   the 2px gaps as hairlines, never as an empty cell. */
/* Six images, so 2 or 3 columns both divide evenly and the deep-stone ground
   never shows as an empty cell. Two columns even on the narrowest phone —
   stacking six images one per row reads as a list, not a grid, and adds about
   700px of scrolling. */
.figure-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  background: var(--deep-stone);
  margin-block-start: clamp(40px, 5vw, 64px);
}
.figure-row img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (min-width: 62em) {
  .figure-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Facts list (the people we work with) --------------------------------- */
.facts { margin: 0; }
.facts__row {
  display: grid;
  gap: 8px;
  padding-block: clamp(22px, 2.4vw, 28px);
  border-top: 1px solid var(--deep-stone);
}
.facts__row:last-child { border-bottom: 1px solid var(--deep-stone); }

@media (min-width: 48em) {
  .facts__row {
    grid-template-columns: minmax(150px, 0.28fr) minmax(0, 0.72fr);
    gap: var(--split-gap);
    align-items: baseline;
  }
}

.facts__key {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--forest);
  font-size: var(--eyebrow-size);
  line-height: 1.4;
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
}
.facts__value {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.68;
}

/* --- S11 Closing band ---------------------------------------------------- */
.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(26px, 3vw, 36px);
  text-align: center;
  background: var(--forest);
  padding: var(--band-pad) clamp(24px, 5vw, 72px) calc(var(--band-pad) + 8px);
}

/* The quill texture. Background surfaces only — never a rule, never a divider,
   never behind body copy. Felt rather than seen. */
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(78deg, var(--near-white) 0 1px, transparent 1px 12px);
  opacity: 0.07;
}

.closing__line {
  max-width: 20ch;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--near-white);
  text-wrap: balance;
}
.closing__email {
  padding: 10px 2px 6px;        /* >=44px tap target */
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--near-white);
  border-bottom-color: var(--deep-stone);
}
.closing__email:hover { color: var(--near-white); border-bottom-color: var(--near-white); }


/* --- Inner pages (privacy) ------------------------------------------------ */
/* No hero to push content clear of the fixed header, so pad from the top. */
.prose-page { padding-block-start: clamp(120px, 14vw, 180px); }

.prose { max-width: 62ch; }
.prose .statement { margin-block-end: clamp(28px, 3vw, 40px); }
.prose p { margin-block-end: 1.1em; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.68; }
.prose h2 {
  margin-block: 2em 0.7em;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--forest);
}
.prose__updated { margin-block-start: 2.5em; font-size: 14px; color: var(--forest); }

/* 7. Footer ================================================================ */

.site-footer {
  margin-block-start: var(--section-gap);
  border-top: 1px solid var(--deep-stone);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 28px;
  padding-block: 40px 56px;
}
.site-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--forest);
}
.site-footer__meta p { margin: 0; }
.site-footer__name { color: var(--ink); }

@media (min-width: 48em) {
  .site-footer__meta { text-align: right; align-items: flex-end; }
}


/* 8. Utilities & motion ==================================================== */

.u-to-sm { display: inline; }
.u-from-sm { display: none; }
@media (min-width: 34em) {          /* 544px — the full address fits from here */
  .u-to-sm { display: none; }
  .u-from-sm { display: inline; }
}

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