/* Backes & Backes — shared stylesheet for every page except the homepage
   (index.html carries its own copy of the header and footer styles; keep the
   two in step).
   Colours come from the homepage photograph: a neutral off-white ground, one
   espresso dark, the logo's orange as the accent. Headings are Spectral,
   reading text is Newsreader, labels and navigation are Public Sans. */
:root {
  --paper: #F0EFEB;
  --ink: #211D18;
  --soft: #676159;
  --band: #E4E2DC;
  --rule: #D6D4CE;
  --dark: #2B211B;          /* espresso: footer, buttons */
  --dark-2: #372B23;
  --on-dark: #ECE7DF;
  --soft-on-dark: #B9B1A4;
  --orange: #D8401F;
  --orange-dk: #B93318;     /* the orange, deepened for links and small text */
  --blue: #7C97A8;
  --blue-lt: #A9C0CE;
  --blue-line: #35688F;   /* a stronger blue, for the line under the current page */
  --green: var(--dark);     /* older name, still used by the calculator */
  --green-ink: #F0EFEB;
  --display: "Spectral", Georgia, "Times New Roman", serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wide: 78rem;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--orange-dk); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }

.shell {
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

/* ---------- header (same as the homepage) ----------
   Phone: logo, phone number and a menu button on one line; the links open
   beneath as a plain list. From 52rem up: one row of links, no button. */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead .shell {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.75rem;
  padding-block: 0.85rem;
}
.brand { margin-right: auto; display: inline-flex; }
.brand img { height: clamp(2rem, 10vw, 2.5rem); width: auto; }
/* the phone number is the header's one action: tap to call */
.masthead .call {
  order: 1; font-family: var(--ui); font-size: clamp(0.8125rem, 3.9vw, 0.9375rem); font-weight: 700; white-space: nowrap;
  color: var(--orange-dk); text-decoration: none; padding-block: 0.6rem;
}
.masthead .call:hover { text-decoration: underline; text-underline-offset: 3px; }
/* menu button: three short rules; becomes an X when the list is open */
.menu-btn {
  order: 2; background: none; border: 0; cursor: pointer;
  width: 2.75rem; height: 2.75rem; margin: -0.4rem -0.6rem -0.4rem 0; padding: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.masthead.open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.masthead.open .menu-btn span:nth-child(2) { opacity: 0; }
.masthead.open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mainnav {
  order: 3; flex-basis: 100%; display: flex; flex-direction: column;
  font-family: var(--ui); font-size: 1.0625rem; font-weight: 500;
  margin-top: 0.6rem;
}
.js .mainnav { display: none; }
.js .masthead.open .mainnav { display: flex; }
.mainnav a {
  color: var(--ink); text-decoration: none;
  padding-block: 0.85rem; border-top: 1px solid rgba(33,29,24,0.16);
}
.mainnav a[aria-current="page"] { font-weight: 700; }   /* the page you are on */
@media (max-width: 21.5rem) { .brand img { height: 1.7rem; } .masthead .shell { gap: 0 0.4rem; } }
@media (min-width: 52rem) {
  .masthead .shell { padding-block: 1.1rem; gap: 0.75rem 2.25rem; }
  .brand img { height: 3.1rem; }
  .menu-btn { display: none; }
  .mainnav, .js .mainnav {
    order: 0; flex-basis: auto; display: flex; flex-direction: row; align-items: center;
    column-gap: 1.8rem; font-size: 0.95rem; margin-top: 0;
  }
  .mainnav a { padding-block: 0.3rem; border-top: 0; border-bottom: 2px solid transparent; }
  .mainnav a:hover { border-bottom-color: var(--ink); }
  .mainnav a[aria-current="page"], .mainnav a[aria-current="page"]:hover { border-bottom-color: var(--blue-line); box-shadow: 0 1px 0 var(--blue-line); }
  .mainnav a[aria-current="page"] { font-weight: 500; }
  /* the number stands apart at the far right, past a hairline */
  .masthead .call { font-size: 1rem; padding: 0.3rem 0 0.3rem 2.25rem; border-left: 1px solid var(--rule); }
}

/* ---------- interior pages ---------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-block: 3.25rem 4.5rem; }
@media (min-width: 62rem) {
  .page { grid-template-columns: minmax(0, 40rem) minmax(0, 17rem); justify-content: space-between; gap: 5rem; }
}
.prose { min-width: 0; display: flex; flex-direction: column; gap: 1.15rem; }
.prose h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); margin-bottom: 0.9rem; }
/* Articles: a small practice-area label above a title set in the article's own
   text, bold and at the same size, so a piece of writing never reads as a department of the firm. */
.eyebrow { font-family: var(--ui); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange-dk); margin: 0 0 0.85rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.prose.post h1 { font-family: var(--text); font-size: 1em; font-weight: 600; line-height: 1.4; margin-bottom: 0.35rem; }
.prose h2 { font-size: 1.7rem; margin-top: 1.5rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.prose blockquote { margin: 0; padding-left: 1.25rem; border-left: 2px solid var(--rule); color: var(--soft); font-size: 1.0625rem; }
.prose .lede { font-size: 1.35rem; line-height: 1.45; }
.prose .ask { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.backlink { font-family: var(--ui); font-size: 0.9375rem; }
.backlink a { color: var(--ink); }

.fees { list-style: none; padding: 0 !important; gap: 0 !important; border-top: 1px solid var(--rule); }
.fees li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; padding-block: 0.85rem; border-bottom: 1px solid var(--rule); font-size: 1.0625rem; line-height: 1.45; }
.fees .amt { font-family: var(--ui); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fees .kind { font-family: var(--ui); font-size: 0.8125rem; color: var(--soft); display: block; }
@media (max-width: 30rem) { .fees li { grid-template-columns: minmax(0, 1fr); } }

.postlist { list-style: none; padding: 0 !important; gap: 0 !important; border-top: 1px solid var(--rule); }
.postlist li { padding-block: 0.8rem; border-bottom: 1px solid var(--rule); }
.postlist a { color: var(--ink); text-decoration: none; font-size: 1.25rem; line-height: 1.3; }
.postlist a:hover { text-decoration: underline; }

/* the office, in view on every page */
.office { font-family: var(--ui); font-size: 0.9375rem; line-height: 1.55; align-self: start; display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 62rem) { .office { position: sticky; top: 2rem; padding-top: 0.6rem; } }
.office .portrait { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--band); }
.office address { font-style: normal; }
.office a { color: var(--ink); }
.office .big { font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; display: block; }
.office .name { font-family: var(--display); font-size: 1.3rem; display: block; margin-bottom: 0.15rem; }

/* side column: a plate from the 1887 view of the town, then related reading */
.aside { font-family: var(--ui); align-self: start; display: flex; flex-direction: column; gap: 2rem; }
.aside .plate { display: none; margin: 0; }
.aside .plate img { width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 86%, transparent), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 86%, transparent), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.aside .plate figcaption { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); margin-top: 0.4rem; }
.related { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.related + .related { border-top: 0; margin-top: -1.1rem; }
.related .lead { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); padding-block: 0.9rem 0.5rem; }
.related a { font-family: var(--display); font-size: 1.0625rem; line-height: 1.3; color: var(--ink); text-decoration: none; padding-block: 0.6rem; border-bottom: 1px solid var(--rule); }
.related a:hover { color: var(--orange-dk); }
.related a.all { font-family: var(--ui); font-size: 0.875rem; font-weight: 600; border-bottom: 0; padding-top: 0.9rem; }
.aside .byline { display: flex; flex-direction: column; gap: 0.2rem; }
.aside .byline .lead { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.aside .byline a { font-family: var(--display); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.aside .byline a:hover { color: var(--orange-dk); }
.aside.photos { gap: 1.25rem; }
.aside.photos img { width: 100%; height: auto; max-width: 22rem; }
@media (min-width: 62rem) {
  .aside { padding-top: 0.6rem; } .aside .plate { display: block; }
  .aside.follow { position: sticky; top: 2rem; }
  .page.solo { grid-template-columns: minmax(0, 42rem); justify-content: center; }
}

/* ---------- people ---------- */
.person { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); margin-top: 1rem; }
.person h2 { margin-top: 0; }
.person img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; max-width: 22rem; background: var(--band); }

/* ---------- footer (same as the homepage) ----------
   The 1887 map, reversed so only its engraved lines show on the espresso. */
.ground { position: relative; background: var(--dark); color: var(--on-dark); overflow: hidden; font-family: var(--ui); font-size: 1rem; line-height: 1.7; }
.ground .map { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 28%;
  filter: grayscale(1) invert(1) contrast(1.15); mix-blend-mode: screen; opacity: 0.4; }
.ground .shell { position: relative; padding-block: 4rem 3.5rem; }
.ground .contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 4rem; align-items: start; }
.ground .lead { font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8125rem; color: var(--blue-lt); margin-bottom: 0.9rem; }
.ground address { font-style: normal; }
.ground address a.tel { display: inline-block; margin-top: 0.35rem; font-size: 1.3rem; font-weight: 600; color: #EC5A33; text-decoration: none; }
.ground address a.tel:hover { text-decoration: underline; text-underline-offset: 4px; }
.ground .more { display: flex; flex-direction: column; gap: 0.3rem; }
.ground .more a { color: var(--on-dark); text-decoration: none; }
.ground .more a:hover { color: #fff; }
.ground .right { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: -1rem; }
.ground .cta { font-weight: 600; color: var(--on-dark); border: 1px solid rgba(236,231,223,0.4); padding: 0.65rem 1.25rem; border-radius: 2px; text-decoration: none; }
.ground .cta:hover { border-color: var(--on-dark); background: rgba(236,231,223,0.08); }
@media (min-width: 52rem) {
  .ground .contact { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
  .ground address { order: -1; }
  .ground .right { flex-direction: column; align-items: stretch; text-align: center; margin-top: 0; }
}
.colophon { background: #1F1813; color: var(--soft-on-dark); font-family: var(--ui); font-size: 0.8125rem; }
.colophon .shell { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; align-items: center; justify-content: space-between; padding-block: 1.1rem; }
.colophon a { color: var(--soft-on-dark); text-decoration: none; }
.colophon a:hover { color: var(--on-dark); }

/* ---------- calculator ---------- */
.calc { display: flex; flex-direction: column; gap: 2.25rem; }
.calc .cite { font-family: var(--ui); font-size: 0.875rem; color: var(--soft); }
.calc section { display: flex; flex-direction: column; gap: 0.75rem; }
.calc h2 { font-size: 1.6rem; margin: 0; }
.calc .sub { color: var(--soft); font-size: 1.0625rem; }
.group { border: 1px solid var(--rule); }
.grouphead { font-family: var(--ui); font-size: 0.875rem; font-weight: 600; padding: 0.6rem 1rem; border-bottom: 1px solid var(--rule); }
.grouphead.yes { background: var(--green); color: var(--green-ink); }
.grouphead.no { background: var(--band); color: var(--soft); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: 0.5rem 1rem; align-items: center; padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.item .lab { font-family: var(--ui); font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.item .why { font-size: 0.9375rem; color: var(--soft); line-height: 1.35; }
.item.excl .lab { font-weight: 400; color: var(--soft); }
.chip { font-size: 0.75rem; background: var(--band); color: var(--soft); padding: 0.05rem 0.4rem; border-radius: 2px; white-space: nowrap; }
.amt { position: relative; }
.amt .d { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); font-family: var(--ui); font-size: 0.9375rem; color: var(--soft); }
.calc input[type="number"] { width: 100%; padding: 0.5rem 0.5rem 0.5rem 1.4rem; font-family: var(--ui); font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; -moz-appearance: textfield; appearance: textfield; }
.calc input[type="number"]::-webkit-outer-spin-button, .calc input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.item.excl input[type="number"] { background: var(--band); color: var(--soft); }
.fid { border: 1px solid var(--rule); padding: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.fid label { font-family: var(--ui); font-size: 0.9375rem; font-weight: 600; }
.fid input[type="number"] { width: 5rem; padding-left: 0.6rem; }
.fid .note { flex-basis: 100%; font-size: 0.9375rem; color: var(--soft); line-height: 1.4; }
.result { background: var(--ink); color: #FFFFFF; padding: 1.5rem 1.35rem; display: flex; flex-direction: column; gap: 1.35rem; font-family: var(--ui); }
.shrinkrow { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; color: #C5CBCF; margin-bottom: 0.3rem; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: #3A4247; position: relative; margin-bottom: 0.6rem; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: #E0B48C; }
.shrinknote { font-size: 0.875rem; color: #C5CBCF; line-height: 1.4; }
table.tiers { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
table.tiers td { padding: 0.35rem 0; border-bottom: 1px solid #353D42; color: #DDE1E3; }
table.tiers td:last-child { text-align: right; }
table.tiers tr.zero td { color: #7D868C; }
table.tiers tr.sum td { border-bottom: 0; color: #FFFFFF; font-weight: 600; padding-top: 0.55rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem; }
.tot .v { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tot .v.big { color: #E0B48C; }
.tot .k { font-size: 0.8125rem; color: #AEB5BA; }
.caveats { display: flex; flex-direction: column; gap: 0.7rem; font-size: 1rem; color: var(--soft); border-top: 1px solid var(--rule); padding-top: 1.1rem; }
@media (max-width: 34rem) { .item { grid-template-columns: minmax(0, 1fr); } }

/* ---------- arriving on a page: the header holds still, the page rises in ----------
   Same tempo and curve as the homepage's opening (1.5s, staggered): the page
   heading first, then the text beneath it, then the side column. It plays
   once on arrival; nothing fades on scroll, so a reader is never kept waiting. */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
::view-transition-old(root) { animation-duration: 0.12s; }
::view-transition-new(root) { animation-duration: 0.12s; }
@media (prefers-reduced-motion: no-preference) {
  .page .prose > h1,
  .page .prose > :not(h1),
  .page > aside {
    opacity: 0; transform: translateY(10px);
    animation: rise 1.5s cubic-bezier(0.25,0.6,0.25,1) forwards;
  }
  .page .prose > .eyebrow { animation-delay: 0.05s; }
  .page .prose > h1 { animation-delay: 0.15s; }
  .page .prose > :not(h1) { animation-delay: 0.45s; }
  .page > aside { animation-delay: 0.75s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- contact form (Cognito Forms embed) ----------
   The form itself lives in Cognito. These lines only restyle it to match the
   site: Cognito reads the --variables below for its fonts and colours. */
.contact-form { margin: 0.5rem 0 2.5rem; }
html .contact-form .cog-cognito.cog-form {
  --font-family: inherit; --font-size: 17px; --color: #211D18;
  --header__font-family: inherit; --heading__font-family: inherit; --heading__color: #211D18;
  --label__font-family: var(--ui, "Public Sans", system-ui, sans-serif);
  --label__color: #211D18; --label__font-weight: 600; --label__font-size: 0.9em;
  --primary: #2B211B; --primary-reverse: #F0EFEB;            /* the Send button: espresso */
  --button-primary__background-color: #2B211B; --button-primary__border-color: #2B211B;
  --button-primary__color: #F0EFEB; --button-primary__font-weight: 600; --button-primary__border-radius: 2px;
  --button-primary__font-family: var(--ui, "Public Sans", system-ui, sans-serif);
  --highlight: #B93318; --highlight-reverse: #fff; --input-highlight: #2B211B;   /* focus ring and required mark: the orange */
  --a__color: #B93318;
  --input__border-color: #B9B3A9; --input__color: #211D18; --placeholder__color: #A39C91;
  --form__background-color: transparent; --form__margins: 0px; --gutter: 22px;
}
/* the page already has its own heading, so Cognito's form title is hidden */
:root:root:root:root:root .contact-form .cog-header { display: none !important; }

/* Article sign-off: author, year first published, review date */
.prose .signoff { margin-top: 2.6rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.prose .signoff span { font-family: var(--ui); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.prose .signoff span::before { content: "·"; margin: 0 0.6em; color: var(--soft); }
.aside .byline .when { font-size: 0.8rem; color: var(--soft); }
.prose h1 + .person { border-top: 0; padding-top: 0; margin-top: 0; }

/* Firm pages (practice areas, About, Fees, Contact) set body text in the
   sans-serif used on the homepage. Articles stay in the serif. Headings keep
   the display face. */
body.sans .prose { font-family: var(--ui); font-size: 1.0625rem; line-height: 1.65; }

/* About: portrait of Pierson. On phones and tablets it sits under his name,
   above the bio. On wide screens it sits beside the bio, its top level with
   the first paragraph, in the space the side column uses on other pages. */
.bio { display: flex; flex-direction: column; gap: 1.15rem; }
.portrait { margin: 0 0 0.25rem; max-width: 28rem; }
.portrait img { width: 100%; height: auto; max-width: none; }
@media (min-width: 62rem) {
  .page.about { grid-template-columns: minmax(0, 40rem); justify-content: start; container-type: inline-size; }
  .bio { position: relative; }
  .bio .portrait { position: absolute; top: 0.3rem; left: calc(100% + 4rem); margin: 0;
    width: min(26rem, calc(100cqw - 100% - 4rem)); max-width: none; }
}
