/* Tim Brown Builders: core system v2
   Pill buttons, scroll-driven entrances, full-bleed photography.
   Shared by all three homepage directions. */

:root {
  --walnut: #4b2e1f;
  --brass: #b08d3c;
  --brass-ink: #7a5b1e;
  --cream: #f6f2ea;
  --cream-200: #eee8dc;
  --charcoal: #252525;
  --ink: #252525;
  --muted: #6a6259;
  --muted-dark: #a8a096;
  --line: rgba(37, 37, 37, 0.12);
  --line-dark: rgba(246, 242, 234, 0.16);

  --container: 1240px;
  --header-h: 68px;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

/* `clip` prevents horizontal overflow WITHOUT creating a scroll container.
   `overflow-x: hidden` here would silently disable animation-timeline: view(). */
html { overflow-x: clip; }

/* height:auto is load-bearing. Every <img> carries width/height attributes for
   CLS prevention; without this the browser honours the height attribute as a
   presentational hint and renders at source height, ignoring aspect-ratio. */
img, picture, video { max-width: 100%; display: block; height: auto; }
svg { display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.7rem + 2.8vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 1.35rem + 1.9vw, 3.1rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.55vw, 1.55rem); letter-spacing: -0.02em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-ink);
  margin-bottom: 1.2rem;
}
.on-dark .eyebrow, .dark .eyebrow { color: var(--brass); }

.lede {
  font-size: clamp(1.1rem, 0.98rem + 0.6vw, 1.35rem);
  line-height: 1.55;
  color: var(--muted);
  letter-spacing: 0;
  max-width: 44rem;
}

/* ---------- buttons: pill, sentence case, no shouting ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 980px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.22s var(--ease-smooth), color 0.22s var(--ease-smooth),
              border-color 0.22s var(--ease-smooth), opacity 0.22s;
}
.btn:hover { opacity: 0.86; }
.btn--fill { background: var(--walnut); color: var(--cream); }
.btn--line { border-color: rgba(37, 37, 37, 0.28); color: var(--ink); }
.btn--line:hover { border-color: var(--ink); opacity: 1; }
.btn--light { background: var(--cream); color: var(--charcoal); }
.btn--glass {
  background: rgba(246, 242, 234, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--glass:hover { background: rgba(246, 242, 234, 0.28); opacity: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* text link with a moving chevron, Apple's quiet CTA */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--brass-ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.link::after { content: "›"; font-size: 1.35em; line-height: 0.8; transition: transform 0.25s var(--ease); }
.link:hover::after { transform: translateX(4px); }
.on-dark .link, .dark .link { color: var(--brass); }

/* ---------- header ---------- */

.hdr {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(246, 242, 234, 0);
  transition: background 0.4s var(--ease-smooth), border-color 0.4s;
  border-bottom: 1px solid transparent;
}

/* Over a photo the nav is white, but object-fit re-crops at every window
   size: a bright sky or wall can land under the header and swallow it.
   This scrim keeps the nav legible whatever the crop does. */
.hdr::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--header-h) + 42px);
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(14, 10, 6, 0.66), rgba(14, 10, 6, 0));
  opacity: 1;
  transition: opacity 0.4s var(--ease-smooth);
}
.hdr.stuck::before, .hdr--light::before { opacity: 0; }
.hdr .container { position: relative; z-index: 1; }
.hdr.stuck {
  background: rgba(246, 242, 234, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.hdr .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.hdr a { text-decoration: none; }

.mark { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); }
.mark svg { width: 34px; height: 34px; }
.mark b {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hdr:not(.stuck) .mark { color: #fff; }

.menu { display: flex; align-items: center; gap: 1.75rem; }
.menu ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.menu ul a { font-size: 0.875rem; font-weight: 450; color: var(--ink); opacity: 0.86; }
.menu ul a:hover { opacity: 1; }
.hdr:not(.stuck) .menu ul a { color: #fff; }

/* pages that open on a light background instead of a photo.
   Must come after the .hdr:not(.stuck) rules above: same specificity, later wins. */
.hdr--light:not(.stuck) .mark,
.hdr--light:not(.stuck) .menu ul a { color: var(--ink); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: none; cursor: pointer;
  padding: 13px 10px;
  flex-direction: column; justify-content: space-between;
}
.burger span { display: block; height: 1.5px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.2s; }
.hdr:not(.stuck) .burger span { background: #fff; }
.hdr--light:not(.stuck) .burger span { background: var(--ink); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .burger { display: flex; }
  .menu {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 1.5rem;
    background: rgba(246, 242, 234, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.26s var(--ease-smooth), transform 0.26s var(--ease);
  }
  .menu.open { opacity: 1; transform: none; pointer-events: auto; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu ul a { color: var(--ink) !important; font-size: 1.05rem; padding: 0.9rem 1.25rem; display: block; border-bottom: 1px solid var(--line); }
  .menu .btn { margin: 1rem 1.25rem 0; }
}

/* ---------- scroll-driven entrances: things pop into frame ---------- */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .pop {
      animation: pop-in linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 32%;
    }
    .pop-sm {
      animation: pop-in-sm linear both;
      animation-timeline: view();
      animation-range: entry 2% cover 26%;
    }
    /* photography grows very slightly as it travels up the viewport */
    .drift {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
  }

  /* fallback for browsers without scroll-driven animations */
  @supports not (animation-timeline: view()) {
    .pop, .pop-sm {
      transform: translateY(38px) scale(0.975);
      filter: blur(5px);
      transition: transform 0.9s var(--ease), filter 0.9s var(--ease);
    }
    .pop.in, .pop-sm.in { transform: none; filter: blur(0); }
  }
}

@keyframes pop-in {
  from { transform: translateY(52px) scale(0.955); filter: blur(7px); }
  to   { transform: none; filter: blur(0); }
}
@keyframes pop-in-sm {
  from { transform: translateY(30px); filter: blur(3px); }
  to   { transform: none; filter: blur(0); }
}
@keyframes drift {
  from { transform: scale(1.14); }
  to   { transform: scale(1); }
}

/* stagger children without JS */
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-range: entry 8% cover 36%; }
.stagger > *:nth-child(3) { animation-range: entry 12% cover 40%; }
.stagger > *:nth-child(4) { animation-range: entry 16% cover 44%; }

/* ---------- the one pinned moment ----------
   A tall track whose sticky child holds for ~2 screens while the copy
   advances over it. Apple uses exactly this shape for its centrepiece
   (93% vh media inside a 400% vh parent) and nowhere else on the page. */

.pin-track { position: relative; }
.pin-stage {
  position: sticky;
  top: var(--header-h);
  height: calc(100svh - var(--header-h));
  overflow: clip;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.pin-stage > picture { position: absolute; inset: 0; z-index: 0; }
.pin-stage > picture img { width: 100%; height: 100%; object-fit: cover; }
.pin-stage > .container { position: relative; z-index: 2; }
.pin-stage::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to right, rgba(12, 9, 6, 0.88) 0%, rgba(12, 9, 6, 0.6) 45%, rgba(12, 9, 6, 0.25) 100%);
}
.pin-copy { color: #fff; max-width: 32rem; }
.pin-copy h2 { color: #fff; }
.pin-beats { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.pin-beat { color: rgba(255, 255, 255, 0.62); transition: color 0.45s var(--ease-smooth); }
.pin-beat.on { color: #fff; }
.pin-beat b { display: block; font-weight: 600; margin-bottom: 0.15rem; }

@media (max-width: 700px) {
  .pin-stage { height: calc(100svh - var(--header-h) - 54px); }
  .pin-copy { max-width: none; }
  .pin-stage::after { background: linear-gradient(to top, rgba(12, 9, 6, 0.92) 20%, rgba(12, 9, 6, 0.5) 70%, rgba(12, 9, 6, 0.3) 100%); }
}

/* ---------- full-bleed media ---------- */

.bleed { position: relative; overflow: clip; }
.bleed img { width: 100%; height: 100%; object-fit: cover; }
.scrim::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14, 10, 6, 0.86) 0%, rgba(14, 10, 6, 0.34) 42%, rgba(14, 10, 6, 0.08) 72%, rgba(14, 10, 6, 0.3) 100%);
}

/* ---------- content blocks ---------- */

.sec { padding: clamp(2.5rem, 2rem + 2vw, 3.75rem) 0; }
.sec--tight { padding: clamp(2.5rem, 2rem + 2vw, 4rem) 0; }
.sec--tint { background: var(--cream-200); }
.dark { background: var(--charcoal); color: var(--cream); }
.dark h1, .dark h2, .dark h3 { color: var(--cream); }
.dark p { color: var(--muted-dark); }

.sec-head { max-width: 44rem; margin-bottom: clamp(1.5rem, 1.2rem + 1vw, 2.25rem); }
.sec-head h2 { font-size: clamp(1.8rem, 1.35rem + 1.9vw, 3.1rem); }

/* service cards: image capped well under one screen */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card picture { border-radius: 10px; overflow: clip; margin-bottom: 1.1rem; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover img { transform: scale(1.04); }
.card h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem); margin-bottom: 0.4rem; }
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0.9rem; }
.card .link { margin-top: auto; }

/* dense photo grid: many small images, the Montana Build model */
.grid-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(0.6rem, 0.4rem + 0.7vw, 1rem); }
.grid-photos figure { margin: 0; border-radius: 8px; overflow: clip; position: relative; cursor: zoom-in; background: var(--cream-200); }
.grid-photos img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 0.8s var(--ease); }
.grid-photos figure:hover img { transform: scale(1.05); }
.grid-photos figcaption {
  position: absolute; inset: auto 0 0; padding: 2rem 0.8rem 0.7rem;
  background: linear-gradient(to top, rgba(14, 10, 6, 0.88), transparent);
  color: #fff; font-size: 0.78rem; line-height: 1.35;
  opacity: 0; transition: opacity 0.28s var(--ease-smooth);
}
.grid-photos figure:hover figcaption, .grid-photos figure:focus-visible figcaption { opacity: 1; }
.grid-photos .span2 { grid-column: span 2; }
.grid-photos .span2 img { aspect-ratio: 2 / 1; }
@media (max-width: 520px) { .grid-photos .span2 { grid-column: span 1; } .grid-photos .span2 img { aspect-ratio: 1 / 1; } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1.5rem; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.9rem, 1.4rem + 2vw, 3rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--walnut); }
.stat span { display: block; margin-top: 0.45rem; font-size: 0.71rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.dark .stat b { color: var(--brass); }
.dark .stat span { color: var(--muted-dark); }

/* numbered process list */
.steps { display: grid; gap: 0; counter-reset: s; }
.step { counter-increment: s; display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 0.7rem + 1.2vw, 2rem); padding: clamp(1.2rem, 1rem + 1vw, 1.9rem) 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before { content: counter(s, decimal-leading-zero); font-family: var(--font-display); font-size: clamp(1.1rem, 1rem + 0.6vw, 1.6rem); font-weight: 600; color: var(--brass-ink); line-height: 1.1; }
.step h3 { font-size: clamp(1.1rem, 1.05rem + 0.35vw, 1.3rem); margin-bottom: 0.25rem; }
.step p { color: var(--muted); font-size: 0.97rem; margin: 0; max-width: 46rem; }
.dark .step { border-color: var(--line-dark); }
.dark .step p { color: var(--muted-dark); }
.dark .step::before { color: var(--brass); }

/* split: copy beside a capped image */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(1.75rem, 1rem + 3vw, 4rem); align-items: center; }
.split picture { border-radius: 12px; overflow: clip; }
.split img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.split__body { max-width: 34rem; }

/* facebook callout */
.fb {
  display: flex; align-items: center; gap: clamp(0.9rem, 0.5rem + 1.5vw, 1.75rem); flex-wrap: wrap;
  padding: clamp(1.1rem, 0.8rem + 1vw, 1.75rem); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: inherit; background: var(--cream);
  transition: border-color 0.3s var(--ease-smooth);
}
.fb:hover { border-color: var(--walnut); }
.fb > svg { width: 34px; height: 34px; flex: 0 0 34px; color: #1877f2; }
.fb b { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.fb span { color: var(--muted); font-size: 0.93rem; }
.fb__t { flex: 1 1 240px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; background: rgba(14, 10, 6, 0.96); padding: clamp(1rem, 3vw, 3rem); }
.lb.open { display: flex; }
.lb img { max-width: 100%; max-height: 84svh; width: auto; object-fit: contain; border-radius: 6px; }
.lb figcaption { position: absolute; inset: auto 0 clamp(0.75rem, 3vw, 1.75rem); text-align: center; color: rgba(246, 242, 234, 0.8); font-size: 0.85rem; padding: 0 4.5rem; }
.lb button { position: absolute; width: 50px; height: 50px; border: 0; border-radius: 50%; background: rgba(246, 242, 234, 0.14); color: #fff; font-size: 1.4rem; cursor: pointer; display: grid; place-items: center; }
.lb button:hover { background: rgba(246, 242, 234, 0.26); }
.lb .x { top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); }
.lb .p { left: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb .n { right: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }

/* ---------- forms ---------- */

.form { display: grid; gap: 1rem; }
.f { display: grid; gap: 0.4rem; }
.f label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); }
.f input, .f select, .f textarea {
  font-family: inherit;
  font-size: 1rem; /* 16px minimum: anything less makes iOS zoom on focus */
  padding: 0.8rem 0.95rem; min-height: 50px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%;
}
.f textarea { min-height: 130px; resize: vertical; }
.f input:focus-visible, .f select:focus-visible, .f textarea:focus-visible { outline: 2px solid var(--walnut); outline-offset: 1px; }
.f-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.note { padding: 0.85rem 1rem; border-radius: 8px; font-size: 0.95rem; }
.note.ok { background: rgba(29, 107, 58, 0.1); color: #1d6b3a; }
.note.err { background: rgba(165, 52, 42, 0.1); color: #a5342a; }

.contact-rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.contact-rail .k { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.contact-rail a { font-weight: 500; text-decoration: none; }

/* ---------- footer ---------- */

.ftr { background: var(--charcoal); color: var(--muted-dark); padding: clamp(3.5rem, 2rem + 5vw, 6rem) 0 0; }
.ftr a { color: var(--cream); text-decoration: none; }
.ftr a:hover { color: var(--brass); }
.ftr-seal { width: 150px; height: 150px; margin-bottom: 1.1rem; }
.ftr-line { font-family: var(--font-display); font-size: 1.05rem; color: var(--cream); margin: 0 0 0.6rem; max-width: 26ch; }
.ftr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: clamp(2rem, 1rem + 3vw, 3.5rem); padding-bottom: 3rem; }
.ftr .ftr-h { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream); margin: 0 0 1rem; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; font-size: 0.93rem; }
.ftr-credit { opacity: 0.72; }
.ftr-credit a { color: var(--cream); border-bottom: 1px solid var(--line-dark); }
.ftr-credit a:hover { color: var(--brass); border-color: var(--brass); }
.ftr-btm {
  border-top: 1px solid var(--line-dark);
  /* extra bottom space so the fixed chat launcher floats over empty footer,
     never over the credit line */
  padding: 1.4rem 0 calc(1.4rem + 92px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center;
  /* clustered left, not space-between: the right side of the viewport belongs
     to the chat launcher and its teaser, which would sit on top of the credit */
  justify-content: flex-start;
  gap: 0.45rem 1.6rem;
  font-size: 0.82rem;
  max-width: 62ch;
}
.ftr-btm > span { white-space: nowrap; }
@media (max-width: 900px) {
  .ftr-btm { padding-bottom: calc(1.4rem + 84px + env(safe-area-inset-bottom)); }
}

/* ---------- mobile call bar ---------- */

.callbar { display: none; }
@media (max-width: 900px) {
  .callbar {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; inset: auto 0 0; z-index: 90;
    background: rgba(28, 28, 28, 0.96);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line-dark);
  }
  .callbar a { display: flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 54px; color: var(--cream); text-decoration: none; font-size: 0.92rem; font-weight: 500; }
  .callbar a + a { background: var(--brass); color: #1c1c1c; }
  .callbar svg { width: 16px; height: 16px; }
  body { padding-bottom: 54px; }
}

/* ---------- a11y ---------- */

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brass-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.dark :where(a, button):focus-visible, .ftr :where(a, button):focus-visible { outline-color: var(--brass); }

.skip { position: absolute; left: -9999px; z-index: 200; padding: 0.8rem 1.2rem; background: var(--walnut); color: var(--cream); }
.skip:focus { left: 1rem; top: 1rem; }

.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .pop, .pop-sm { transform: none !important; filter: none !important; }
}

.no-js .pop, .no-js .pop-sm { transform: none; filter: none; }

/* Without JS the burger cannot toggle, so the mobile menu must not start
   hidden or the site becomes unnavigable on a phone. */
.no-js .burger { display: none; }
@media (max-width: 900px) {
  .no-js .hdr { position: static; height: auto; padding: 0.5rem 0; background: var(--cream); border-bottom: 1px solid var(--line); }
  .no-js .hdr .container { flex-wrap: wrap; }
  .no-js .menu {
    position: static; opacity: 1; transform: none; pointer-events: auto;
    background: none; backdrop-filter: none; border: 0; padding: 0.5rem 0 0; width: 100%;
  }
  .no-js .menu a { color: var(--ink) !important; }
  .no-js .hero > .container { padding-top: 2rem; }
  .no-js .pin-stage { position: static; height: auto; padding: 3rem 0; }
  .no-js .pin-track { height: auto !important; }
}

/* ---------- chat widget ---------- */

.chat-fab {
  position: fixed;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: clamp(1rem, 2vw, 1.75rem);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1.35rem 0.55rem 0.55rem;
  border: 0;
  border-radius: 980px;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(37, 25, 15, 0.34);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(37, 25, 15, 0.42); }
.chat-fab[hidden] { display: none; }

.chat-av {
  position: relative;
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: var(--walnut);
  display: grid; place-items: center;
}
.chat-av svg { width: 30px; height: 30px; color: var(--cream); }
.chat-av::after {
  content: "";
  position: absolute;
  right: -1px; bottom: -1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #3fb768;
  border: 2.5px solid var(--charcoal);
}
.chat-fab__t { text-align: left; line-height: 1.25; }
.chat-fab__t b { display: block; font-size: 0.94rem; font-weight: 600; }
.chat-fab__t span { display: block; font-size: 0.74rem; color: var(--muted-dark); }

/* teaser: a nudge, never an auto-opened panel */
.chat-tease {
  position: fixed;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: calc(clamp(1rem, 2vw, 1.75rem) + 68px);
  z-index: 95;
  width: min(calc(100vw - 2rem), 290px);
  display: none;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 14px 40px rgba(37, 25, 15, 0.22);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  animation: chat-rise 0.5s var(--ease) both;
}
.chat-tease.show { display: flex; }
.chat-tease b { display: block; font-weight: 600; margin-bottom: 0.1rem; }
.chat-tease span { color: var(--muted); }
.chat-tease .x {
  position: absolute; top: -9px; right: -9px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--cream);
  color: var(--muted); font-size: 0.95rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
@keyframes chat-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.chat-panel {
  position: fixed;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: clamp(1rem, 2vw, 1.75rem);
  z-index: 96;
  width: min(calc(100vw - 2rem), 408px);
  height: min(calc(100svh - 5rem), 660px);
  display: none;
  flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(37, 25, 15, 0.34);
  overflow: hidden;
}
.chat-panel.open { display: flex; animation: chat-rise 0.32s var(--ease) both; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--charcoal);
  color: var(--cream);
  flex: 0 0 auto;
}
.chat-head .chat-av { width: 42px; height: 42px; flex-basis: 42px; }
.chat-head .chat-av svg { width: 29px; height: 29px; }
.chat-head__t { line-height: 1.3; }
.chat-head__t b { display: block; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.chat-head__t span { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--muted-dark); }
.chat-head__t i { width: 7px; height: 7px; border-radius: 50%; background: #3fb768; display: inline-block; }
.chat-head button {
  margin-left: auto;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(246, 242, 234, 0.14);
  color: var(--cream);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.chat-head button:hover { background: rgba(246, 242, 234, 0.26); }

.chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.chat-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-row.me { justify-content: flex-end; }
.chat-row__av {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; background: var(--walnut);
  display: grid; place-items: center; margin-bottom: 2px;
}
.chat-row__av svg { width: 18px; height: 18px; color: var(--cream); }
.chat-msg {
  max-width: 84%;
  padding: 0.68rem 0.9rem;
  border-radius: 15px;
  font-size: 0.93rem;
  line-height: 1.52;
  white-space: pre-wrap;
}
.chat-msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-msg.me { background: var(--walnut); color: var(--cream); border-bottom-right-radius: 5px; }
.chat-msg a { color: var(--brass-ink); font-weight: 600; }
.chat-msg.me a { color: var(--cream); }

.chat-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.chat-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-blink 1.3s infinite ease-in-out; }
.chat-dots i:nth-child(2) { animation-delay: 0.18s; }
.chat-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-blink { 0%, 80%, 100% { opacity: 0.22; } 40% { opacity: 1; } }

.chat-hints { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.7rem; }
.chat-hints button {
  border: 1px solid rgba(122, 91, 30, 0.4);
  background: rgba(176, 141, 60, 0.08);
  border-radius: 980px;
  padding: 0.48rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--brass-ink);
  cursor: pointer;
  text-align: left;
}
.chat-hints button:hover { background: var(--walnut); border-color: var(--walnut); color: var(--cream); }

.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); flex: 0 0 auto; }
.chat-form input {
  flex: 1 1 auto;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px minimum or iOS zooms on focus */
  padding: 0.7rem 0.95rem;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: #fff;
  color: var(--ink);
}
.chat-form input:focus-visible { outline: 2px solid var(--walnut); outline-offset: 1px; }
.chat-form button {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: var(--walnut); color: var(--cream);
  cursor: pointer; display: grid; place-items: center;
}
.chat-form button:disabled { opacity: 0.45; cursor: default; }
.chat-form button svg { width: 18px; height: 18px; }

.chat-foot { padding: 0 1rem 0.8rem; font-size: 0.72rem; color: var(--muted); }
.chat-foot a { color: var(--brass-ink); font-weight: 600; }
.chat-power {
  margin: 0;
  padding: 0 1rem 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.75;
}
.chat-power a { color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.chat-power a:hover { color: var(--brass-ink); }

/* The mobile call bar owns the bottom of the screen. The launcher sits above
   it and the panel stops short of it, so calling is never obstructed. */
@media (max-width: 900px) {
  .chat-fab { bottom: calc(54px + env(safe-area-inset-bottom) + 0.75rem); padding-right: 1.1rem; }
  .chat-tease { bottom: calc(54px + env(safe-area-inset-bottom) + 0.75rem + 68px); }
  .chat-panel {
    right: 0.5rem; left: 0.5rem; width: auto;
    bottom: calc(54px + env(safe-area-inset-bottom) + 0.5rem);
    height: min(calc(100svh - 54px - 4.5rem), 580px);
  }
}
@media (max-width: 400px) {
  .chat-fab__t b { font-size: 0.88rem; }
  .chat-fab__t span { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab:hover { transform: none; }
  .chat-dots i { animation: none; opacity: 0.6; }
  .chat-tease, .chat-panel.open { animation: none; }
}

.no-js .chat-fab, .no-js .chat-tease { display: none; }
