@import url("https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&display=swap");

/* Halden & Reeve LLP — a bound volume from Chancery Lane.
   Ivory page, navy ink, one brass rule. See DESIGN.md. */

:root {
  --vellum: #F6F2E7;
  --vellum-deep: #ECE5D3;
  --ink: #16233B;
  --slate: #4A5468;
  --brass: #9A7B45;
  --brass-ink: #7A5F30;
  --hairline: #CFC6B2;

  --font-head: "Libre Caslon Text", "Baskerville", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --step-h1: clamp(2.1rem, 1.5rem + 3vw, 3.6rem);
  --step-h2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-h3: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-body: 1.0625rem;
  --step-small: 0.9rem;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space-s: 0.75rem;
  --space-m: 1.5rem;
  --space-l: clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(4rem, 9vw, 7.5rem);
  --measure: 64ch;
  --rule: 1px solid var(--hairline);
  --rule-brass: 1px solid var(--brass);
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.18;
  margin: 0 0 var(--space-m);
  overflow-wrap: break-word;
  hyphens: manual;
  letter-spacing: -0.005em;
}
h1 { font-size: var(--step-h1); line-height: 1.08; }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

em, i { font-style: italic; }
strong { font-weight: 600; }
small, .small { font-size: var(--step-small); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--brass-ink); text-decoration-color: var(--brass-ink); }

:focus-visible {
  outline: 2px solid var(--brass-ink);
  outline-offset: 3px;
  border-radius: 1px;
}

hr, .rule {
  border: 0;
  border-top: var(--rule-brass);
  margin: 0;
  width: 100%;
}
.rule--ink { border-top-color: var(--ink); }
.rule--short { width: 4.5rem; }

ul, ol { padding: 0; margin: 0; }

svg { display: block; max-width: 100%; height: auto; }

address { font-style: normal; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-xl); }
.section + .section { border-top: var(--rule); }
.section--deep { background: var(--vellum-deep); }
.section--tight { padding-block: var(--space-l); }

/* Small caps labels — used where a book would have one, never everywhere. */
.label {
  display: block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  color: var(--brass-ink);
  margin: 0 0 var(--space-s);
}

.lead {
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.55;
  color: var(--slate);
  max-width: 48ch;
}

.muted { color: var(--slate); }

/* ---------- Accessibility helpers ---------- */

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--vellum);
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; color: var(--vellum); }

/* ---------- Header & navigation ---------- */

.site-header {
  border-bottom: var(--rule-brass);
  background: var(--vellum);
  position: relative;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 4.75rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__amp { font-style: italic; color: var(--brass); }
.brand__llp {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  color: var(--slate);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 600 1rem/1 var(--font-body);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.1rem;
  height: 1px;
  background: currentColor;
  position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--vellum);
  border-bottom: var(--rule-brass);
  padding: var(--space-s) var(--gutter) var(--space-m);
}
.site-nav[data-open="true"] { display: block; }

.site-nav__list { list-style: none; }
.site-nav__list li { border-top: var(--rule); }
.site-nav__list li:first-child { border-top: 0; }
.site-nav a {
  display: block;
  padding: 0.85rem 0;
  text-decoration: none;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  font-size: 1.1rem;
  color: var(--ink);
}
.site-nav a:hover { color: var(--brass-ink); }
.site-nav a[aria-current="page"] {
  color: var(--brass-ink);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 0.4em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 600 1.05rem/1 var(--font-body);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--vellum); }
.btn--solid { background: var(--ink); color: var(--vellum); }
.btn--solid:hover { background: var(--brass-ink); border-color: var(--brass-ink); color: var(--vellum); }
.btn--on-ink { border-color: var(--vellum); color: var(--vellum); }
.btn--on-ink:hover { background: var(--vellum); color: var(--ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-m);
  margin-top: var(--space-l);
}

.link-quiet {
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  font-size: 1.05rem;
  white-space: nowrap;
}

/* ---------- Hero: title page with gatehouse ---------- */

.hero { padding-block: var(--space-l) var(--space-xl); }
.hero__grid {
  display: grid;
  gap: var(--space-l);
  align-items: end;
}
.hero__text h1 { max-width: 13ch; margin-bottom: var(--space-m); }
.hero__art {
  margin: 0;
  max-width: 26rem;
  justify-self: center;
  width: 100%;
}
.hero__caption {
  margin-top: var(--space-s);
  font-size: var(--step-small);
  color: var(--slate);
  text-align: center;
  font-style: italic;
  font-family: var(--font-head);
}

.arch__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arch__fine { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-linecap: round; }
.arch__detail { fill: none; stroke: var(--brass); stroke-width: 1.2; stroke-linecap: round; }
.arch__course { fill: none; stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 12 5; }
.arch__ground { fill: none; stroke: var(--brass); stroke-width: 1; }

/* ---------- Contents: practice areas as a book's contents ---------- */

.contents__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s) var(--space-m);
  border-bottom: var(--rule-brass);
  padding-bottom: var(--space-m);
  margin-bottom: var(--space-s);
}
.contents__head h2 { margin: 0; }

.contents { list-style: none; counter-reset: none; }
.contents__item { border-bottom: var(--rule); }
.contents__link {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  column-gap: var(--space-s);
  align-items: baseline;
  padding: 1.35rem 0;
  text-decoration: none;
  color: var(--ink);
}
.contents__num {
  font-family: var(--font-head);
  font-style: italic;
  color: var(--brass-ink);
  font-size: 1.15rem;
}
.contents__line { display: flex; align-items: baseline; min-width: 0; gap: 0.6rem; }
.contents__title {
  font-family: var(--font-head);
  font-size: var(--step-h3);
  line-height: 1.25;
  overflow-wrap: break-word;
}
.contents__leader {
  display: none;
  flex: 1;
  border-bottom: 2px dotted var(--brass);
  transform: translateY(-0.3em);
  min-width: 2rem;
}
.contents__mark {
  font-family: var(--font-head);
  color: var(--brass);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.contents__desc {
  grid-column: 2 / 4;
  margin-top: 0.35rem;
  color: var(--slate);
  font-size: 1rem;
  max-width: 56ch;
}
.contents__link:hover .contents__title { color: var(--brass-ink); }
.contents__link:hover .contents__mark { transform: translateX(4px); }

/* ---------- Preface with marginal notes ---------- */

.preface { display: grid; gap: var(--space-l); }
.marginalia {
  list-style: none;
  display: grid;
  gap: var(--space-m);
  align-content: start;
}
.marginalia li {
  border-top: var(--rule-brass);
  padding-top: 0.6rem;
}
.marginalia__note {
  display: block;
  font-family: var(--font-head);
  font-size: 1.25rem;
  line-height: 1.3;
}
.marginalia .label { margin: 0 0 0.2rem; }

.prose h2 { margin-bottom: var(--space-m); }
.prose h3 { margin-top: var(--space-l); }
.prose ul { list-style: none; margin: 0 0 1.1em; max-width: var(--measure); }
.prose ul li {
  padding: 0.55rem 0 0.55rem 1.4rem;
  border-bottom: var(--rule);
  position: relative;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 0.6rem;
  border-top: var(--rule-brass);
}

/* ---------- Pair: two columns with hairline between ---------- */

.pair { display: grid; gap: var(--space-l); }
.pair__col h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); }
.pair__col + .pair__col { border-top: var(--rule); padding-top: var(--space-l); }

/* ---------- Note (single statement + link) ---------- */

.note {
  display: grid;
  gap: var(--space-m);
  align-items: baseline;
}
.note h2 { margin: 0; }

/* ---------- Letterhead ---------- */

.letterhead {
  display: grid;
  gap: var(--space-l);
  border-top: 3px double var(--brass);
  padding-top: var(--space-l);
}
.letterhead__block .label { margin-bottom: 0.4rem; }
.letterhead__line {
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.letterhead__line a { text-decoration-color: var(--hairline); }
.letterhead__line a:hover { text-decoration-color: var(--brass); }

/* ---------- Inner page head ---------- */

.page-head { padding-block: var(--space-l) var(--space-l); border-bottom: var(--rule-brass); }
.page-head__num {
  display: block;
  font-family: var(--font-head);
  font-style: italic;
  font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.4rem);
  color: var(--brass);
  margin-bottom: var(--space-s);
}
.page-head h1 { max-width: 18ch; }

.breadcrumb {
  font-size: var(--step-small);
  color: var(--slate);
  margin-bottom: var(--space-m);
}
.breadcrumb a { color: var(--slate); }

/* ---------- Partner profiles (ledger) ---------- */

.profiles { list-style: none; display: grid; gap: 0; border-top: var(--rule-brass); }
.profile {
  padding: var(--space-m) 0 var(--space-l);
  border-bottom: var(--rule);
}
.profile__role { margin-bottom: 0.3rem; }
.profile__name { font-size: var(--step-h3); margin-bottom: var(--space-s); }
.profile__bio { color: var(--slate); }
.profile__contact { margin-top: var(--space-s); font-size: var(--step-small); }

/* ---------- Insight articles ---------- */

.articles { list-style: none; display: grid; gap: var(--space-l); }
.article {
  border-top: var(--rule-brass);
  padding-top: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  color: var(--brass-ink);
}
.article__title { font-size: var(--step-h3); margin: 0; }
.article__title a { text-decoration: none; }
.article__title a:hover { text-decoration: underline; text-decoration-color: var(--brass); }
.article__standfirst { color: var(--slate); }

/* ---------- Forms ---------- */

.form { display: grid; gap: var(--space-m); max-width: 44rem; }
.form__row { display: grid; gap: var(--space-m); }
.form__field { display: grid; gap: 0.4rem; }
.form__label {
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  color: var(--ink);
}
.form__hint { font-size: var(--step-small); color: var(--slate); }
.form__input {
  width: 100%;
  font: 400 1.0625rem/1.5 var(--font-body);
  color: var(--ink);
  background: var(--vellum);
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.7rem 0.15rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form__input:hover { background: var(--vellum-deep); }
.form__input:focus { outline: none; border-bottom-color: var(--brass); background: var(--vellum-deep); }
.form__input:focus-visible { outline: 2px solid var(--brass-ink); outline-offset: 2px; }
textarea.form__input { min-height: 9rem; resize: vertical; border: 1px solid var(--ink); padding: 0.75rem; }
select.form__input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.form__field[data-state="error"] .form__input { border-color: #8A2B1E; }
.form__field[data-state="error"] .form__label::after { content: " — required"; color: #8A2B1E; }
.form__check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: var(--step-small); color: var(--slate); }
.form__check input { margin-top: 0.3rem; accent-color: var(--ink); }
.form__status { min-height: 1.5em; margin: 0; font-family: var(--font-head); font-style: italic; }
.form__status[data-state="sent"] { color: var(--ink); }
.form__status[data-state="error"] { color: #8A2B1E; }

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

.site-footer {
  background: var(--ink);
  color: var(--vellum);
  padding-block: var(--space-l) var(--space-m);
  margin-top: 0;
}
.site-footer a { color: var(--vellum); text-decoration-color: var(--brass); }
.site-footer a:hover { color: var(--vellum-deep); text-decoration-color: var(--vellum); }
.site-footer .label { color: var(--brass); }
.site-footer .brand { color: var(--vellum); }
.site-footer .brand__llp { color: var(--hairline); }
.footer__grid { display: grid; gap: var(--space-l); }
.footer__list { list-style: none; display: grid; gap: 0.35rem; }
.footer__list .contents__num { color: var(--brass); font-size: 1rem; margin-right: 0.5rem; }
.footer__base {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--brass);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-m);
  justify-content: space-between;
  font-size: var(--step-small);
  color: var(--hairline);
}
.footer__base p { margin: 0; }

/* ---------- Style guide helpers ---------- */

.swatches { list-style: none; display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.swatch { border: var(--rule); }
.swatch__chip { height: 6rem; border-bottom: var(--rule); }
.swatch__chip--vellum { background: var(--vellum); }
.swatch__chip--vellum-deep { background: var(--vellum-deep); }
.swatch__chip--ink { background: var(--ink); }
.swatch__chip--slate { background: var(--slate); }
.swatch__chip--brass { background: var(--brass); }
.swatch__chip--brass-ink { background: var(--brass-ink); }
.swatch__chip--hairline { background: var(--hairline); }
.swatch__text { padding: 0.75rem; font-size: var(--step-small); }
.swatch__name { display: block; font-family: var(--font-head); font-size: 1.05rem; }
.specimen { display: grid; gap: var(--space-m); }
.specimen__h1 { font-size: var(--step-h1); line-height: 1.08; margin: 0; }
.specimen__row { display: grid; gap: 0.3rem; border-bottom: var(--rule); padding-bottom: var(--space-m); }
.sg-block { margin-top: var(--space-l); }
.sg-demo { border: 1px dashed var(--hairline); padding: var(--space-m); }

/* ---------- Breakpoints ---------- */

@media (min-width: 600px) {
  .contents__leader { display: block; }
  .contents__link { grid-template-columns: 4rem 1fr auto; }
  .form__row { grid-template-columns: 1fr 1fr; }
  .letterhead { grid-template-columns: repeat(2, 1fr); }
  .articles { grid-template-columns: 1fr 1fr; column-gap: var(--space-l); }
  .profiles { grid-template-columns: 1fr 1fr; column-gap: var(--space-l); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .site-nav__list { display: flex; gap: 1.75rem; }
  .site-nav__list li { border: 0; }
  .site-nav a { padding: 0.4rem 0; font-size: 1.05rem; }

  .hero { padding-top: var(--space-xl); }
  .hero__grid { grid-template-columns: 1.15fr 1fr; gap: var(--space-xl); }
  .hero__art { justify-self: end; }

  .preface { grid-template-columns: 14rem 1fr; gap: var(--space-xl); }

  .pair { grid-template-columns: 1fr 1fr; gap: 0; }
  .pair__col { padding-right: var(--space-l); }
  .pair__col + .pair__col {
    border-top: 0;
    border-left: var(--rule);
    padding-top: 0;
    padding-left: var(--space-l);
    padding-right: 0;
  }

  .note { grid-template-columns: 14rem 1fr auto; gap: var(--space-xl); }
  .letterhead { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .page-head__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-xl); align-items: end; }
}

@media (min-width: 1200px) {
  :root { --step-body: 1.125rem; }
  .contents__link { grid-template-columns: 5rem 1fr auto; padding: 1.6rem 0; }
  .preface { grid-template-columns: 16rem 1fr; }
  .profiles { grid-template-columns: repeat(3, 1fr); }
}

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

@media print {
  .site-header, .nav-toggle, .site-footer, .skip-link { display: none; }
  body { background: #FFFFFF; }
}
