/*
  Purefit system: tokens, base, grid, section box, nav, buttons, links, forms, footer.
  One system for the whole page. Palette and fonts arrive as --p-* and --font-* from the <style> block in the page.
*/

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 0; scroll-behavior: auto; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

:root {
  /* colour */
  --bg: var(--p-bg);
  --surface: var(--p-surface);
  --ink: var(--p-ink);
  --muted: var(--p-muted);
  --accent: var(--p-accent);
  --action: var(--p-action);
  --action-ink: var(--p-action-ink);
  --c-text: #ded7dc;                      /* running text: 84% ink on the ground */
  --line: rgba(255, 255, 255, .13);
  --line-2: rgba(255, 255, 255, .28);
  --card: var(--p-surface);
  /* the lit ground (data-ground="sage"): behind UI and in the closing slab */
  --lit: #cdd6c6;
  --lit-2: #dce3d6;
  --lit-ink: #262d24;
  --lit-muted: #485044;
  --lit-line: rgba(38, 45, 36, .18);

  /* spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* rhythm */
  --nav: 72px;
  --padt: clamp(96px, 13.34svh, 120px);
  --padb: clamp(56px, 8svh, 72px);
  --gut: 80px;
  --hgap: 48px;
  --hpadb: 64px;
  --bar: 0px;
  --head-gap: var(--s-7);
  --card-gap: var(--s-5);

  /* type */
  --t-h2: clamp(30px, 1.714vw + 23.3px, 48px);
  --t-h3: clamp(24px, .381vw + 22.5px, 28px);
  --t-lead: clamp(18px, .19vw + 17.26px, 20px);
  --t-card: clamp(18px, .19vw + 17.26px, 20px);
  --t-body: 16px;
  --t-small: 14px;
  --t-label: 13px;

  /* radius: round */
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-btn: 12px;
  --btn-h: 44px;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --m-ease-enter: cubic-bezier(.22, 1, .36, 1);
  --m-ease-io: cubic-bezier(.65, 0, .35, 1);
  --m-in: 150ms; --m-out: 120ms; --m-press: 90ms; --m-panel: 200ms; --m-close: 120ms; --m-slide: 240ms;
  --m-cycle: 3.2s;
}

@media (max-width: 1023px) { :root { --gut: 48px; } }
@media (max-width: 639px) {
  :root { --nav: 56px; --padt: 96px; --padb: 48px; --gut: 24px; --hgap: 40px; --hpadb: 24px; --head-gap: var(--s-6); --card-gap: var(--s-3); }
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.625 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html.nav-open { overflow: hidden; }

h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); text-wrap: balance; }
h2 { font-size: var(--t-h2); line-height: 1.1; }
h3 { font-size: var(--t-h3); line-height: 1.2; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.muted { color: var(--muted); }
.t-lead { font-size: var(--t-lead); line-height: 1.5; color: var(--c-text); max-width: 34em; }
.t-lead.muted { color: var(--muted); }
.t-card { font: 500 var(--t-card)/1.4 var(--font-text); letter-spacing: -.01em; }
.t-small { font-size: var(--t-small); line-height: 1.45; }
.t-label { font: 500 var(--t-label)/1.25 var(--font-text); letter-spacing: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- the wrap and the grid */
.wrap { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; }
main > section > .wrap, footer.closing > .wrap { position: relative; z-index: 1; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: var(--card-gap); }
.grid--top { align-items: start; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.start-7.span-6 { grid-column: 7 / span 6; }
.start-8.span-5 { grid-column: 8 / span 5; }
.start-10.span-3 { grid-column: 10 / span 3; }
@media (max-width: 639px) { .grid { column-gap: 12px; } }
@media (max-width: 1023px) {
  .grid > [class*="span-"] { grid-column: 1 / -1; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .grid.cards > .span-6 { grid-column: span 6; }
}

/* ---------------------------------------------------------------- the section box: one or two screens */
main > section, footer.closing {
  position: relative;
  min-height: calc(var(--h, 1) * 100svh);
  padding: var(--padt) 0 calc(var(--padb) + var(--bar));
  display: flex; flex-direction: column;
}
main > section > .wrap { flex: 1 1 auto; display: flex; flex-direction: column; }
@media (max-width: 639px) {
  main > section:not(.hero) { min-height: calc(var(--hm, var(--h, 1)) * 100lvh); }
}
.ground-surface { background: var(--surface); }

.section-head { margin-bottom: var(--head-gap); }
.section-head.grid { row-gap: var(--s-5); align-items: start; }
.section-head__side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); }

/* two screens as two groups: row 2 starts --padt under the second screen's top */
@media (min-width: 1024px) {
  .wrap.g2 { display: grid; grid-template-rows: minmax(calc(100svh - var(--padt) - var(--padb)), auto) auto; row-gap: calc(var(--padt) + var(--padb)); align-content: start; }
}
@media (max-width: 1023px) { .wrap.g2 { display: flex; flex-direction: column; row-gap: var(--card-gap); } }

/* the split: text left, the visual right, top-aligned */
.split__text { display: flex; flex-direction: column; align-items: flex-start; }
.split__text > h2 + * { margin-top: var(--s-5); }
.facts { list-style: none; padding: 0; margin-top: var(--s-5); width: 100%; max-width: 34em; }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--c-text); }
.facts li:first-child { border-top: 1px solid var(--line); }
.split__text > .link { margin-top: var(--s-5); }
@media (max-width: 1023px) { .split { row-gap: var(--s-7); } }
/* the tablet: the split stacks, and its frame takes what is left of the screen */
@media (min-width: 640px) and (max-width: 1023px) {
  .split:has(> .frame--split) { flex: 1 1 auto; grid-template-rows: auto minmax(320px, 1fr); }
  .split > .frame--split { aspect-ratio: auto; height: 100%; }
  .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; max-width: none; }
  .facts li, .facts li:first-child { border-top: 1px solid var(--line); border-bottom: 0; }
}

/* a frame holds one visual */
.frame { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); }
.frame--split { aspect-ratio: 5 / 4; }
.frame__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639px) { .frame--split { aspect-ratio: 1; } .frame { border-radius: 18px; } }
.fill { flex: 1 1 0; }

/* ---------------------------------------------------------------- nav: one fixed, opaque bar */
.nav { position: fixed; inset: 0 0 auto 0; height: var(--nav); background: var(--bg); border-bottom: 1px solid var(--line); z-index: 10; }
.nav__bar { height: 100%; display: flex; align-items: center; gap: var(--s-6); }
.nav__logo { display: inline-flex; align-items: center; gap: 10px; height: 44px; color: var(--ink); text-decoration: none; font: var(--display-weight) 20px/1 var(--font-display); letter-spacing: -.02em; }
.mark { color: var(--ink); flex: none; }
.mark__dot { fill: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 28px; height: 100%; margin-left: var(--s-4); }
.nav__item { display: flex; align-items: center; height: 100%; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; font: 500 15px/1 var(--font-text); color: var(--c-text); text-decoration: none; white-space: nowrap; }
.chev { flex: none; }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.nav__toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 1px solid var(--line-2); border-radius: var(--r-btn); cursor: pointer; color: var(--ink); padding: 0; }
.nav__links .nav__sheet-cta { display: none; }

.nav__menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--s-6) 0 40px; visibility: hidden; opacity: 0; }
.nav__item.is-open > .nav__menu { visibility: visible; opacity: 1; }
.menu-col { display: flex; flex-direction: column; gap: var(--s-1); }
.menu-col > .t-label { color: var(--muted); margin-bottom: var(--s-3); }
.menu-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; text-decoration: none; }
.menu-link__name { font: 500 16px/1.4 var(--font-text); color: var(--ink); }
.menu-link__line { font-size: var(--t-small); line-height: 1.4; color: var(--muted); }
.menu-card { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 8px 16px; }
.menu-card__panel { position: relative; display: block; height: 160px; border-radius: 10px; overflow: hidden; background: radial-gradient(120% 100% at 25% 15%, #e4eadd 0%, var(--lit) 48%, #b8c4b0 100%); }
.menu-card__title { margin: 14px 8px 0; color: var(--ink); }
.menu-card__line { margin: 2px 8px 0; font-size: var(--t-small); line-height: 1.4; color: var(--muted); }

.skip-link { position: absolute; left: max(var(--gut), (100vw - 1280px) / 2); top: calc((var(--nav) - 44px) / 2); height: 44px; display: inline-flex; align-items: center; padding: 0 16px; background: var(--ink); color: var(--bg); border-radius: var(--r-btn); font: 500 15px/1 var(--font-text); text-decoration: none; z-index: 2; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

@media (max-width: 1023px) {
  .nav__toggle { display: inline-flex; }
  .nav__links { position: fixed; inset: var(--nav) 0 0 0; height: auto; margin: 0; padding: var(--s-2) var(--gut) var(--s-5); background: var(--bg); display: none; flex-direction: column; align-items: stretch; gap: 0; overflow-y: auto; }
  .nav.is-open .nav__links { display: flex; }
  .nav__item { height: auto; display: block; }
  .nav__link { height: 56px; width: 100%; font-size: 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav__menu, .chev { display: none; }
  .nav.is-open .nav__toggle-a { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-open .nav__toggle-b { transform: translateY(-3.5px) rotate(-45deg); }
  .nav__toggle path { transform-origin: 10px 10px; transform-box: view-box; }
}
@media (max-width: 639px) {
  .nav__actions .nav__cta { display: none; }
  .nav__links .nav__sheet-cta { display: inline-flex; height: 48px; width: 100%; }
  .nav__links { padding-top: 0; }
  .nav.is-open .nav__links { min-height: calc(100svh - var(--nav)); }
  .nav__links .nav__sheet-cta { margin-top: var(--s-6); }
}

/* ---------------------------------------------------------------- buttons (look: arrow) and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--btn-h); padding: 0 24px; border: 1px solid transparent; border-radius: var(--r-btn); font: 500 16px/1 var(--font-text); text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn--primary { background: var(--action); color: var(--action-ink); padding-right: 20px; }
.btn--secondary { background: none; color: var(--ink); padding: 0 4px; border-radius: 6px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--line-2); }
.m-arrow { flex: none; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); }
@media (max-width: 639px) {
  .btn-row { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .btn-row .btn--primary { height: 48px; }
}

.link { display: inline; color: var(--ink); text-decoration: none; font-weight: 500; padding-bottom: 3px; }

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

/* ---------------------------------------------------------------- questions: every answer open */
.faq__item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq__item:first-child { padding-top: 0; }
.faq__item h3 { font: 500 var(--t-card)/1.4 var(--font-text); letter-spacing: -.01em; }
.faq__item p { margin-top: 6px; color: var(--c-text); max-width: 62ch; }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
.field { width: 100%; }
.field label { display: block; font: 500 var(--t-small)/1.4 var(--font-text); margin-bottom: var(--s-2); }
.field__row { display: flex; gap: var(--s-2); align-items: stretch; }
.field input { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 16px; font: 400 16px/1 var(--font-text); color: var(--ink); background: rgba(255, 255, 255, .5); border: 1px solid var(--line-2); border-radius: var(--r-btn); appearance: none; }
.field__row .btn { height: 48px; flex: none; }
.field__error { margin-top: var(--s-2); font-size: var(--t-small); line-height: 1.4; font-weight: 500; }
.form__status { font-size: var(--t-small); line-height: 1.4; min-height: 0; }
.form__status:not(:empty) { margin-top: var(--s-3); }
.form__note, .form__sent { margin-top: var(--s-3); font-size: var(--t-small); line-height: 1.4; }
[hidden] { display: none !important; }
@media (max-width: 639px) {
  .field__row { flex-direction: column; }
  .field__row .btn { width: 100%; }
}

/* ---------------------------------------------------------------- the closing slab: close-word on footer-statement
   footer.closing is one screen like every section; the slab is drawn 8px in from the window's sides and bottom. */
footer.closing.footer--statement {
  --ink: var(--lit-ink); --muted: var(--lit-muted); --c-text: var(--lit-ink); --line: var(--lit-line); --line-2: rgba(38, 45, 36, .36);
  color: var(--ink);
}
footer.closing.footer--statement::before { content: ""; position: absolute; inset: 0 8px 8px; border-radius: var(--r-lg); background: radial-gradient(130% 110% at 18% 0%, #e2e8db 0%, var(--lit) 46%, #bcc8b4 100%); }
footer.closing.footer--statement > .wrap { flex: 1 1 auto; display: flex; flex-direction: column; }
footer.closing :focus-visible { outline-color: var(--lit-ink); }
.closing__cta { display: flex; flex-direction: column; }
.close__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.close__copy { grid-column: 1 / span 6; }
.close__head .form { grid-column: 8 / span 5; }
@media (min-width: 1024px) and (max-width: 1279px) { .close__head .form { grid-column: 7 / span 6; } }
.close__word {
  margin-top: 40px;
  /* hand-set: the name's own width is 2.672em at this tracking, so it runs from line to line at every width */
  font: var(--display-weight) calc(min(100vw - 2 * var(--gut), 1280px) / var(--word-em, 2.672))/.74 var(--font-display);
  letter-spacing: -.05em;
  white-space: nowrap;
  user-select: none;
}
.closing__links { margin-top: auto; padding-top: var(--s-4); }
.footer__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.footer__lede { grid-column: 1 / span 6; font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; }
.footer__col:nth-of-type(1) { grid-column: 9 / span 2; }
.footer__col:nth-of-type(2) { grid-column: 11 / span 2; }
.footer__col h3 { font: 500 var(--t-label)/1.25 var(--font-text); letter-spacing: 0; color: var(--muted); margin-bottom: var(--s-2); }
.footer__col a { position: relative; display: inline-flex; align-items: center; min-height: 32px; font-size: 16px; line-height: 1.4; text-decoration: none; color: var(--ink); }
.footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-5); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--t-small); line-height: 1.45; }
.footer__legal a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.field input::placeholder { color: var(--muted); }

@media (max-width: 1023px) {
  .close__head { display: flex; flex-direction: column; gap: var(--s-6); }
  .close__head .form { max-width: 520px; }
  .footer__cols { display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-8); }
  .footer__lede { flex: 1 1 100%; }
}
@media (max-width: 639px) {
  footer.closing.footer--statement { min-height: 100lvh; }
  footer.closing.footer--statement::before { inset: 0; border-radius: 0; }
  .footer__lede { display: none; }
  .close__head { gap: var(--s-5); }
  .close__word { margin-top: var(--s-5); }
  .footer__col a { min-height: 44px; }
  .footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .footer__col:nth-of-type(n) { grid-column: auto; }
  .footer__legal a { min-height: 44px; display: inline-flex; align-items: center; }
}
