/*
  Ace Pactum Template Library — design system.
  Identity: a reading room, not a document factory. Warm paper, ink, and one
  vermilion "seal" accent that is reserved for locked/unlock moments.
  Site text font is Pactum Book Octagon and the brand mark font is Pactum
  Notch, both self-hosted from public/fonts (CLAUDE.md), with system font
  stacks as fallback. No inline styles: public/_headers sets a CSP
  of style-src 'self', so every rule lives in this file (see astro.config.mjs,
  build.inlineStylesheets). Fonts load under default-src 'self'.
*/

/* Pactum Notch: one weight (400), basic Latin only. Glyphs it lacks (₹ § @ %
   curly quotes, dashes, accents) fall back to the next family in the stack. */
@font-face {
  font-family: 'Pactum Notch';
  src: url('/fonts/PactumNotch-Regular.woff2') format('woff2'),
    url('/fonts/PactumNotch-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Pactum Book Octagon: site text font, four faces (400/700, roman/italic). */
@font-face {
  font-family: 'Pactum Book Octagon';
  src: url('/fonts/PactumBookOctagon-Regular.woff2') format('woff2'),
    url('/fonts/PactumBookOctagon-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pactum Book Octagon';
  src: url('/fonts/PactumBookOctagon-Italic.woff2') format('woff2'),
    url('/fonts/PactumBookOctagon-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Pactum Book Octagon';
  src: url('/fonts/PactumBookOctagon-Bold.woff2') format('woff2'),
    url('/fonts/PactumBookOctagon-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pactum Book Octagon';
  src: url('/fonts/PactumBookOctagon-BoldItalic.woff2') format('woff2'),
    url('/fonts/PactumBookOctagon-BoldItalic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f5f4f2;
  --sheet: #ffffff;
  --ink: #0b1a2e;
  --muted: #6b7280;
  --rule: #e0e2e6;
  --soft: #e8eaed;
  --seal: #c8551e;
  --brand: #c8551e;
  --silver: #cbcfd3;
  --seal-ink: #ffffff;
  --focus: #0b1a2e;

  --pactum-book-octagon: 'Pactum Book Octagon', 'Century Schoolbook', Century, Georgia, serif;
  --serif: var(--pactum-book-octagon);
  --pactum: 'Pactum Notch', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: var(--pactum-book-octagon);

  --radius: 6px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0b1a2e;
    --sheet: #12253d;
    --ink: #f6f2ee;
    --muted: #b0b6c0;
    --rule: #27405c;
    --soft: #16304a;
    --seal: #e6a27e;
    --seal-ink: #0b1a2e;
    --brand: #e6a27e;
    --focus: #f6f2ee;
  }
}

/* Pages with the fire backdrop always use the dark palette. */
:root[data-theme='dark'] {
  --paper: #0b1a2e;
  --sheet: #12253d;
  --ink: #f6f2ee;
  --muted: #b0b6c0;
  --rule: #27405c;
  --soft: #16304a;
  --seal: #e6a27e;
  --seal-ink: #0b1a2e;
  --brand: #e6a27e;
  --focus: #f6f2ee;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
}

h2 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

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

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.brand__mark {
  width: 56px;
  padding: 2px;
}

.brand__word {
  width: auto;
  padding: 2px 6px;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding-block: 1.5rem 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .disclaimer {
  margin: 0 0 0.75rem;
  max-width: 62ch;
}

/* ---------- Catalogue ---------- */

.hero {
  padding-block: clamp(2rem, 6vw, 4.5rem) 1.5rem;
  max-width: 46rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 40rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--seal);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 2.5rem;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.steps li::before {
  content: '0' counter(step);
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
}

.steps strong {
  color: var(--ink);
}

.filters {
  display: grid;
  gap: 1rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 6.5rem;
}

.chip {
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.search {
  font: inherit;
  width: min(100%, 22rem);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink);
  border-radius: var(--radius);
}

.result-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.card__family {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.card__title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.card__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px dashed var(--rule);
  padding-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag {
  font-size: 0.78rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  background: var(--paper);
}

.tag--side {
  border-color: var(--ink);
  color: var(--ink);
}

.lock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--seal);
  font-weight: 600;
}

.lock svg {
  width: 14px;
  height: 14px;
}

.empty {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Template detail ---------- */

.crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  padding-block: 1.25rem 0.5rem;
}

.detail-head {
  max-width: 46rem;
  padding-bottom: 1.5rem;
}

.detail-head p {
  color: var(--muted);
  font-size: 1.05rem;
}

.detail {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  .detail {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 3rem;
  }

  .panel {
    position: sticky;
    top: 1.5rem;
  }
}

/* Each preview sheet is a static image of one page (pages 1 and 2 only).
   Neither the page HTML nor the images hold anything past page 2, so removing
   the lock card below reveals nothing more. */

.sheet-wrap {
  max-width: 640px;
  width: 100%;
  margin: 0;
}

.sheet {
  container-type: inline-size;
  position: relative;
  width: 100%;
  background: #fffdf8;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgba(30, 28, 24, 0.35);
  overflow: hidden;
}

.sheet picture,
.sheet img {
  display: block;
  width: 100%;
  height: auto;
}

.fill {
  color: inherit;
  background: color-mix(in srgb, var(--seal) 14%, transparent);
  border-radius: 2px;
  padding: 0 0.15em;
}

.seal {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.25rem 1.5rem;
  max-width: 21rem;
  background: var(--sheet);
  border: 1px solid var(--seal);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -14px rgba(30, 28, 24, 0.5);
}

.seal svg {
  width: 30px;
  height: 30px;
  color: var(--seal);
  margin-bottom: 0.35rem;
}

.seal h2 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.seal p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.sheet-caption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel h2 {
  font-size: 1.1rem;
}

.facts {
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  font-size: 0.9rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  text-align: right;
}

.panel__unlock {
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
}

/* ---------- Forms and buttons (access gate) ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
}

.btn:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--seal {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--seal-ink);
}

.btn--seal:hover:not(:disabled) {
  background: transparent;
  color: var(--seal);
}

.btn--block {
  display: block;
  width: 100%;
}

.gate {
  display: grid;
  gap: 0.85rem;
}

.gate label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.gate input[type='email'],
.gate input:not([type]) {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
}

.gate .consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.gate .consent input {
  margin-top: 0.2rem;
}

.gate .note,
.gate [role='alert'] {
  font-size: 0.85rem;
  margin: 0;
}

.gate [role='alert'] {
  color: var(--seal);
}

.price {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: 0.2rem;
}

/* ---------- Prose pages (privacy) ---------- */

.prose {
  max-width: 44rem;
  padding-block: 2rem;
}

.prose h2 {
  margin-top: 1.75rem;
}

/* ---------- Browse pages (categories, jurisdictions, search, how it works) ---------- */

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.section-title {
  margin: 2rem 0 1rem;
}

.cat-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 0.75rem;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 100%;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.cat-tile:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.cat-tile svg {
  width: 26px;
  height: 26px;
  color: var(--seal);
  margin-bottom: 0.3rem;
}

.cat-tile__name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
}

.cat-tile__blurb {
  font-size: 0.85rem;
  color: var(--muted);
}

.cat-tile__count {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cat-tile__count--ready {
  color: var(--seal);
  font-weight: 600;
}

.soon {
  color: var(--muted);
  font-weight: 600;
}

.card--planned {
  border-style: dashed;
  background: transparent;
}

.card--planned:hover {
  border-color: var(--rule);
  transform: none;
}

.notice-box {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--muted);
  max-width: 46rem;
  margin: 0 0 1.5rem;
}

.juris-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.juris-links .chip {
  text-decoration: none;
}

.more-link {
  margin-top: 2rem;
}

.process {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
  counter-reset: process;
}

.process li {
  counter-increment: process;
  border-top: 2px solid var(--ink);
  padding-top: 0.75rem;
  color: var(--muted);
}

.process li::before {
  content: 'Step ' counter(process);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.process h2 {
  color: var(--ink);
  margin: 0.25rem 0 0.5rem;
}

/* ---------- Homepage ---------- */

.home-hero {
  background: linear-gradient(135deg, #0b1a2e 0%, #16304f 60%, #c8551e 100%);
  color: #fff;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(5rem, 10vw, 8rem);
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.9rem);
  line-height: 1.1;
  max-width: 17ch;
  margin: 0.4rem auto 1rem;
}

.home-hero h1 em {
  font-style: italic;
  color: #e6a27e;
}

.home-hero .eyebrow {
  color: var(--silver);
}

.home-hero p {
  color: var(--silver);
  font-size: 1.15rem;
  max-width: 38rem;
  margin-inline: auto;
}

.home-hero .btn {
  background: var(--seal);
  color: var(--seal-ink);
  border-color: var(--seal);
  text-decoration: none;
  display: inline-block;
}

.home-hero .btn--ghost {
  /* Solid-ish backing: the fire glows behind this button, especially on phones. */
  background: rgba(11, 26, 46, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.home-cats {
  margin-top: -4rem;
}

.home-cats .cat-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.home-cats .cat-tile {
  border-top: 4px solid var(--seal);
  padding: 1.5rem;
  box-shadow: 0 18px 40px -22px rgba(11, 26, 46, 0.55);
}

.home-cats .cat-tile__count {
  color: var(--brand);
  font-weight: 600;
}

.home-steps {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.home-steps h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.home-steps h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  background: var(--seal);
  margin: 0.75rem auto 0;
}

.home-steps .steps {
  margin: 2rem 0 0;
  text-align: left;
}

.home-steps .steps li {
  border-top-color: var(--brand);
}

.home-steps .steps li::before {
  color: var(--seal);
}

.home-band {
  background: var(--ink);
  color: var(--paper);
  padding-block: 2rem;
}

.home-band .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.home-band h2 {
  margin: 0;
  color: inherit;
}

.home-band p {
  margin: 0;
  color: var(--silver);
}

.home-band .btn {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--seal-ink);
  text-decoration: none;
}

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

.home-search {
  display: flex;
  max-width: 44rem;
  margin: 2rem auto 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
}

.home-search select,
.home-search input,
.home-search button {
  font: inherit;
  border: 0;
  color: #0b1a2e;
  background: #fff;
}

.home-search select {
  flex: 0 0 auto;
  max-width: 11rem;
  padding: 0.9rem 0.75rem;
  background: #eff0f2;
  border-right: 1px solid #e0e2e6;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.home-search input {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1rem;
}

.home-search button {
  flex: 0 0 auto;
  padding: 0.9rem 1.5rem;
  background: var(--seal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.home-search button:hover {
  filter: brightness(1.1);
}

@media (max-width: 560px) {
  .home-search {
    flex-wrap: wrap;
  }

  .home-search select {
    flex: 1 0 100%;
    max-width: none;
    border-right: 0;
    border-bottom: 1px solid #e0e2e6;
  }
}

/* ---------- Two-page preview, account, purchase gate ---------- */

.sheet--page {
  margin-bottom: 0.75rem;
}

.seal--card {
  max-width: none;
  margin-top: 0.25rem;
}

.linklike {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

.gate__terms {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.purchases {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 1rem;
}

.purchase {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 46rem;
}

.purchase__title {
  margin: 0;
}

.purchase__sub {
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.purchase__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ---------- Polish pass ---------- */

/* Header: always a clean white bar, so the logo artwork sits on white in both themes. */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e2e6;
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header .brand img {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.site-header .brand {
  gap: 0.75rem;
}

.site-header .site-nav {
  gap: 1.6rem;
  font-size: 0.92rem;
}

.site-header .site-nav a {
  color: #6b7280;
  padding-block: 0.35rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-header .site-nav a:hover,
.site-header .site-nav a[aria-current='page'] {
  color: #0b1a2e;
  text-decoration: none;
  border-bottom-color: #c8551e;
}

/* Hero: depth from soft logo-colour glows and a faint grid. */
.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 320px at 12% 18%, rgba(200, 85, 30, 0.28), transparent 70%),
    radial-gradient(640px 420px at 88% 8%, rgba(200, 85, 30, 0.35), transparent 70%),
    linear-gradient(135deg, #0b1a2e 0%, #12263f 58%, #c8551e 100%);
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.home-hero .wrap {
  position: relative;
}

.home-hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  max-width: 20ch;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}

.home-hero .eyebrow {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  letter-spacing: 0.16em;
}

.home-search {
  max-width: 48rem;
  border-radius: 14px;
  padding: 0.35rem;
  gap: 0.35rem;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.home-search select,
.home-search button {
  border-radius: 10px;
}

.home-search input:focus-visible,
.home-search select:focus-visible {
  outline-offset: -2px;
}

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--silver);
}

.hero-badges li::before {
  content: '✓';
  color: #e6a27e;
  font-weight: 700;
  margin-right: 0.45rem;
}

/* Fire backdrop: fixed to the viewport behind the page, so content scrolls
   over it. z-index -1 puts it above the body background and below all content.
   `screen` drops the canvas's black so only the glow shows; it is set on the
   wrapper because a stacking context isolates its children's blend modes. */
.fire-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}

.fire-backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.fire-backdrop__fire {
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%);
  mask-image: linear-gradient(to top, #000 55%, transparent 100%);
}

/* With the backdrop, the hero shows it through rather than painting over it. */
.has-fire .home-hero {
  background:
    radial-gradient(520px 320px at 12% 18%, rgba(200, 85, 30, 0.22), transparent 70%),
    radial-gradient(640px 420px at 88% 8%, rgba(200, 85, 30, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(11, 26, 46, 0.55), rgba(18, 38, 63, 0.25));
}

/* Parallax: the hero copy drifts up slower than the page and fades out. */
.has-fire .home-hero .wrap {
  transform: translate3d(0, calc(var(--parallax, 0) * 0.14px), 0);
  opacity: clamp(0.2, calc(1 - var(--parallax, 0) / 420), 1);
  will-change: transform, opacity;
}

/* Panels let a little of the glow through. */
.has-fire .home-cats .cat-tile,
.has-fire .home-steps .steps li {
  background: color-mix(in srgb, var(--sheet) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.has-fire .home-band {
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(200, 85, 30, 0.3), transparent 70%),
    linear-gradient(135deg, rgba(11, 26, 46, 0.78), rgba(22, 48, 79, 0.7));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.has-fire .site-footer {
  background: rgba(7, 17, 30, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .has-fire .home-hero .wrap {
    transform: none;
    opacity: 1;
  }
}

.hero-badges li {
  text-shadow: 0 1px 12px rgba(11, 26, 46, 0.9);
}

/* Category cards */
.home-cats .cat-tile {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 12px;
  border-top-width: 0;
  overflow: hidden;
}

.home-cats .cat-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--seal), var(--brand));
}

.home-cats .cat-tile svg {
  width: 52px;
  height: 52px;
  padding: 13px;
  margin-bottom: 0.9rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 11%, var(--sheet));
  color: var(--brand);
}

.home-cats .cat-tile__name {
  font-size: 1.25rem;
}

.home-cats .cat-tile__count {
  padding-top: 1rem;
}

.home-cats .cat-tile:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 26px 44px -24px rgba(11, 26, 46, 0.6);
}

.juris-links {
  justify-content: center;
  margin-top: 1.75rem;
}

/* Steps as numbered cards */
.home-steps {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.home-steps .steps {
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.home-steps .steps li {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--sheet);
  padding: 1.5rem 1.4rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.home-steps .steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--seal);
  color: var(--seal-ink);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.home-steps .steps strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

/* Search band */
.home-band {
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(200, 85, 30, 0.35), transparent 70%),
    linear-gradient(135deg, #0b1a2e, #16304f);
  padding-block: 2.75rem;
  color: #fff;
}

.home-band h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

.home-band .btn {
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
}

/* Footer */
.site-footer {
  margin-top: 0;
  padding-block: 2rem 2.5rem;
  background: #07111e;
  border-top: 0;
  color: var(--silver);
}

.site-footer .disclaimer strong {
  color: #fff;
}

.site-footer .foot-links a {
  color: var(--silver);
}

.site-footer .foot-links a:hover {
  color: #fff;
}

/* Pactum Book Octagon is wide: keep the hero headline to about four lines on a phone. */
@media (max-width: 480px) {
  .home-hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 720px) {
  .home-hero .eyebrow {
    letter-spacing: 0.1em;
    font-size: 0.7rem;
  }
}

/* ---------- Header v2: sticky, frosted, compact ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #e3e5e9;
  box-shadow: 0 6px 20px -16px rgba(11, 26, 46, 0.55);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #c8551e, #c8551e 60%, transparent);
  opacity: 0.85;
}

.site-header .wrap {
  max-width: 1200px;
  padding-block: 0.55rem;
}

.site-header .brand img {
  height: 48px;
}

.site-header .brand__mark {
  width: 48px;
}

.site-header .site-nav {
  gap: 0.25rem;
  font-size: 0.92rem;
}

.site-header .site-nav a {
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: 99px;
  color: #3f4856;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.site-header .site-nav a:hover {
  background: #eff0f2;
  color: #0b1a2e;
}

.site-header .site-nav a[aria-current='page'] {
  background: #0b1a2e;
  color: #fff;
}

@media (max-width: 720px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding-block: 0.4rem 0.3rem;
  }

  .site-header .brand {
    justify-content: center;
  }

  .site-header .brand img {
    height: 36px;
  }

  .site-header .brand__mark {
    width: 36px;
  }

  /* One scrollable row, so the pinned header stays slim. */
  .site-header .site-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.15rem;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  .site-header .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-header .site-nav a {
    flex: 0 0 auto;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* Search box with the jurisdiction selector beside it (browse and search pages). */
.browse-search {
  display: flex;
  width: 100%;
  max-width: 44rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 28px -20px rgba(11, 26, 46, 0.55);
}

.browse-search:focus-within {
  border-color: var(--brand);
}

.browse-search select,
.browse-search input {
  font: inherit;
  color: var(--ink);
  border: 0;
  background: transparent;
}

.browse-search select {
  flex: 0 0 auto;
  max-width: 11.5rem;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--soft);
  border-right: 1px solid var(--rule);
  cursor: pointer;
}

.browse-search input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
}

.browse-search input:focus-visible,
.browse-search select:focus-visible {
  outline-offset: -2px;
}

@media (max-width: 560px) {
  .browse-search {
    flex-wrap: wrap;
  }

  .browse-search select {
    flex: 1 0 100%;
    max-width: none;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

/* ---------- Homepage search bar v2 ---------- */

.home-search {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 50rem;
  margin: 2.25rem auto 0;
  padding: 0.4rem;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.8), 0 0 0 5px rgba(255, 255, 255, 0.14);
  transition: box-shadow 0.2s;
}

.home-search:focus-within {
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.8), 0 0 0 5px rgba(230, 162, 126, 0.5);
}

.home-search__juris,
.home-search__field {
  position: relative;
  display: flex;
  align-items: center;
}

.home-search__juris {
  flex: 0 0 auto;
  border-right: 1px solid #e0e2e6;
}

.home-search__field {
  flex: 1;
  min-width: 0;
}

.home-search svg {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: #6b7280;
  pointer-events: none;
}

.home-search select,
.home-search input {
  font: inherit;
  color: #0b1a2e;
  background: transparent;
  border: 0;
  height: 3.4rem;
}

.home-search select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 12.5rem;
  padding: 0 2.4rem 0 2.8rem;
  border-radius: 14px 0 0 14px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 16px;
}

.home-search select:hover {
  background-color: #f3f4f6;
}

.home-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0 1rem 0 2.9rem;
  font-size: 1.05rem;
}

.home-search input::placeholder {
  color: #6b7280;
}

.home-search button {
  flex: 0 0 auto;
  height: 3.4rem;
  padding: 0 2rem;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #d4602a, #b04818);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(200, 85, 30, 0.9);
}

.home-search button:hover {
  filter: brightness(1.08);
}

.home-search select:focus-visible,
.home-search input:focus-visible {
  outline: none;
}

@media (max-width: 640px) {
  .home-search {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 0.35rem;
  }

  .home-search__juris {
    flex: 1 0 100%;
    border-right: 0;
    border-bottom: 1px solid #e0e2e6;
  }

  .home-search select {
    max-width: none;
    width: 100%;
    border-radius: 12px 12px 0 0;
  }

  .home-search__field {
    flex: 1 1 10rem;
  }

  .home-search input {
    font-size: 1rem;
  }

  .home-search button {
    padding: 0 1.25rem;
  }
}

/* ---------- Homepage v3: distinctive layer ---------- */

/* Headline: an ink stroke draws under the italic phrase. */
.home-hero h1 em {
  background: linear-gradient(90deg, #e6a27e, #f3cdb6) no-repeat 0 94% / 0% 0.09em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-bottom: 0.08em;
  animation: ink-draw 1.1s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes ink-draw {
  to {
    background-size: 100% 0.09em;
  }
}

/* Category tiles: a running index in the brand-mark font, arrow on hover. */
.home-cats .cat-grid {
  counter-reset: cat;
}

.home-cats .cat-tile {
  counter-increment: cat;
}

.home-cats .cat-tile::after {
  content: '0' counter(cat);
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  font-family: var(--pactum);
  font-size: 2.6rem;
  line-height: 1;
  color: color-mix(in srgb, var(--ink) 14%, transparent);
  transition: color 0.2s, transform 0.2s;
}

.home-cats .cat-tile:hover::after {
  color: var(--seal);
  transform: translateY(-3px);
}

.home-cats .cat-tile__count {
  transition: letter-spacing 0.2s;
}

.home-cats .cat-tile:hover .cat-tile__count {
  letter-spacing: 0.06em;
}

/* Anatomy of a template */
.home-anatomy {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5.5rem) 0;
}

@media (min-width: 900px) {
  .home-anatomy {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.home-anatomy h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}

.anatomy__lede {
  color: var(--muted);
  max-width: 34rem;
}

.side-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.5rem 0 1.5rem;
  padding: 0.25rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: color-mix(in srgb, var(--sheet) 70%, transparent);
}

.side-toggle legend {
  float: left;
  margin-right: 0.75rem;
  padding: 0.5rem 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.side-toggle label {
  padding: 0.4rem 1.1rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
  transition: background-color 0.2s, color 0.2s;
}

.side-toggle input:checked + label {
  background: var(--seal);
  color: var(--seal-ink);
}

.side-toggle input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.anatomy__notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  counter-reset: note;
}

.anatomy__notes li {
  counter-increment: note;
  position: relative;
  padding-left: 2.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.anatomy__notes li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1.5px solid var(--seal);
  color: var(--seal);
  font-family: var(--pactum);
  font-size: 1rem;
}

.anatomy__notes strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.anatomy__stage {
  position: relative;
  min-height: 27rem;
  max-width: 28rem;
  width: 100%;
  margin-inline: auto;
  perspective: 1200px;
}

.doc {
  position: absolute;
  inset: 0 2rem 1.5rem 0;
  background: #fffdf8;
  color: #0b1a2e;
  border-radius: 6px;
  box-shadow: 0 30px 60px -26px rgba(0, 0, 0, 0.8);
}

.doc--back {
  transform: translate(2rem, 1.5rem) rotate(4deg);
  opacity: 0.55;
}

.doc--front {
  padding: 2rem 1.75rem;
  transform: rotate(-2.5deg);
  animation: doc-float 7s ease-in-out infinite;
  transition: transform 0.4s;
}

.anatomy__stage:hover .doc--front {
  transform: rotate(0deg) translateY(-6px);
  animation-play-state: paused;
}

@keyframes doc-float {
  50% {
    transform: rotate(-1.5deg) translateY(-8px);
  }
}

.doc__kicker {
  margin: 0 0 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
}

.doc__title {
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #0b1a2e;
  font-family: var(--pactum);
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc__line {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
}

.doc .fill {
  background: rgba(200, 85, 30, 0.16);
  box-shadow: inset 0 -2px 0 rgba(200, 85, 30, 0.55);
  padding: 0.05em 0.35em;
}

.ln {
  display: block;
  height: 0.5rem;
  margin: 0.8rem 0 0;
  border-radius: 3px;
  background: #e3e5e9;
}

.ln--short {
  width: 62%;
}

.when-a,
.when-b {
  font-weight: 700;
  color: #c8551e;
}

.when-b {
  display: none;
}

.home-anatomy:has(#side-b:checked) .when-a {
  display: none;
}

.home-anatomy:has(#side-b:checked) .when-b {
  display: inline;
}

.doc__line {
  position: relative;
}

.pin {
  position: absolute;
  top: 50%;
  right: -2.55rem;
  margin-top: -0.85rem;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #c8551e;
  color: #fff;
  font-family: var(--pactum);
  font-size: 0.95rem;
  box-shadow: 0 0 0 4px rgba(200, 85, 30, 0.22);
  animation: pin-pulse 2.4s ease-in-out infinite;
}

@keyframes pin-pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(200, 85, 30, 0);
  }
}

.doc__lock {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 2.6rem 1.75rem 1.1rem;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0), #fffdf8 55%);
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

.doc__lock .pin {
  right: -0.8rem;
  top: auto;
  bottom: 1.6rem;
  margin: 0;
}

.doc__stamp {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px double #c8551e;
  color: #c8551e;
  font-family: var(--pactum);
  font-size: 1.1rem;
  transform: rotate(-12deg);
}

/* Steps: joined by a dashed thread on wide screens. */
@media (min-width: 760px) {
  .home-steps .steps {
    position: relative;
  }

  .home-steps .steps::before {
    content: '';
    position: absolute;
    top: 2.7rem;
    left: 12%;
    right: 12%;
    border-top: 2px dashed color-mix(in srgb, var(--seal) 55%, transparent);
  }

  .home-steps .steps li {
    position: relative;
  }
}

.home-steps .steps li::before {
  font-family: var(--pactum);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--seal) 20%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero h1 em {
    animation: none;
    background-size: 100% 0.09em;
  }

  .doc--front,
  .pin {
    animation: none;
  }
}

/* Brochure download (home page) */
.home-brochure {
  margin-block: 3rem;
}
.home-brochure__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.75rem clamp(1.1rem, 4vw, 2rem);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--seal);
  border-radius: var(--radius);
  background: var(--sheet);
}
.home-brochure__card h2 {
  margin-bottom: 0.25em;
}
.home-brochure__card p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
}
.home-brochure__card .eyebrow {
  margin-bottom: 0.5rem;
  color: var(--seal);
}
.home-brochure__card .btn {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--seal-ink);
  text-decoration: none;
}

/* Brochure mascot icons on category tiles */
.cat-tile .cat-tile__img {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 0.6rem;
  /* The artwork is an octagon on a white square; trim the corners. */
  clip-path: polygon(29.5% 0, 70.5% 0, 100% 29.5%, 100% 70.5%, 70.5% 100%, 29.5% 100%, 0 70.5%, 0 29.5%);
}

/* ---------- Header: Ember Orange bar, brochure-style logo ---------- */
.site-header {
  background: linear-gradient(180deg, #d05a20 0%, #c8551e 100%);
  border-bottom: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 24px -14px rgba(11, 26, 46, 0.75);
}

.site-header::after {
  background: #0b1a2e;
  opacity: 1;
  height: 3px;
}

.site-header .wrap {
  padding-block: 0.8rem;
}

.site-header .brand {
  gap: 0.9rem;
  text-decoration: none;
}

/* Monogram in a white octagon, as on the brochure. */
.site-header .brand img.brand__mark {
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  padding: 7px;
  background: #fff;
  object-fit: contain;
  clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--pactum);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.brand__tag {
  font-size: 0.7rem;
  line-height: 1.35;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fbe3d3;
}

.site-header .site-nav {
  gap: 0.35rem;
}

.site-header .site-nav a {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 99px;
  color: #fff;
  font-weight: 600;
}

.site-header .site-nav a:hover {
  background: rgba(11, 26, 46, 0.25);
  color: #fff;
}

.site-header .site-nav a[aria-current='page'] {
  background: #0b1a2e;
  color: #fff;
  border: 0;
}

@media (max-width: 720px) {
  .site-header .wrap {
    padding-block: 0.55rem 0.4rem;
  }

  .site-header .brand img.brand__mark {
    width: 40px;
    height: 40px;
    padding: 5px;
  }

  .brand__name {
    font-size: 1.3rem;
  }

  .brand__tag {
    display: none;
  }
}

/* Wordmark beside the menu: original artwork on a white panel. */
.site-header__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-word {
  display: flex;
  align-items: center;
  padding: 5px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 0 rgba(11, 26, 46, 0.35), 0 8px 18px -10px rgba(11, 26, 46, 0.6);
}

.brand-word img {
  display: block;
  width: auto;
  height: 38px;
}

@media (max-width: 720px) {
  .site-header .wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.4rem 0.75rem;
  }

  .site-header__right {
    display: contents;
  }

  .brand-word {
    justify-self: start;
    padding: 4px 12px;
  }

  .brand-word img {
    height: 30px;
  }

  .site-header .site-nav {
    grid-column: 1 / -1;
  }

  .brand__text {
    display: none;
  }
}

/* ---------- Header: cylinder effect (convex shading, rounded ends) ---------- */
.site-header {
  background:
    linear-gradient(
      180deg,
      #a8420f 0%,
      #d9672b 14%,
      #ec8247 30%,
      #de6a2c 46%,
      #c8551e 64%,
      #a8420f 86%,
      #7e300a 100%
    );
  border-radius: 0 0 44px 44px;
  box-shadow:
    inset 0 2px 0 rgba(255, 220, 190, 0.55),
    inset 0 -3px 6px rgba(60, 20, 0, 0.45),
    0 14px 26px -12px rgba(0, 0, 0, 0.7),
    0 3px 0 #0b1a2e;
}

.site-header::after {
  display: none;
}

.site-header .wrap {
  padding-inline: clamp(20px, 4vw, 44px);
}

/* Specular streak along the upper third, like light on a tube. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 5px 28px auto 28px;
  height: 28%;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.site-header .wrap,
.site-header .brand,
.site-header__right {
  position: relative;
  z-index: 1;
}

.site-header .site-nav a[aria-current='page'] {
  background: linear-gradient(180deg, #243b5a 0%, #0b1a2e 55%, #050d18 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 6px -2px rgba(0, 0, 0, 0.6);
}

.site-header .site-nav a {
  text-shadow: 0 1px 2px rgba(60, 20, 0, 0.55);
}

.site-header .brand-word {
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 55%, #d9dbe0 100%);
}

@media (max-width: 720px) {
  .site-header {
    border-radius: 0 0 28px 28px;
  }

  .site-header::before {
    inset-inline: 18px;
  }
}

/* ---------- Responsive header: stack below 960px ---------- */
.site-header .site-nav a {
  white-space: nowrap;
}

@media (max-width: 960px) {
  .site-header .wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.45rem 0.75rem;
    padding-block: 0.6rem 0.5rem;
  }

  .site-header__right {
    display: contents;
  }

  .brand-word {
    justify-self: start;
    padding: 4px 12px;
  }

  .brand-word img {
    height: 32px;
  }

  .site-header .brand img.brand__mark {
    width: 44px;
    height: 44px;
    padding: 6px;
  }

  .site-header .site-nav {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.2rem;
    padding: 0.15rem 0.1rem 0.35rem;
    scrollbar-width: none;
  }

  .site-header .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-header .site-nav a {
    flex: 0 0 auto;
    padding: 0.4rem 0.85rem;
    font-size: 0.88rem;
  }

  .brand__text {
    display: none;
  }
}

@media (min-width: 961px) and (max-width: 1100px) {
  .brand__tag {
    display: none;
  }
}

/* Home category tiles: 1 / 2 / 4 columns, never an orphan row of 3 + 1. */
.home-cats .cat-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .home-cats .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .home-cats .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Wordmark in the footer: original artwork on a white panel. */
.foot-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.foot-tag {
  margin: 0;
  font-family: var(--pactum);
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--seal);
}

.foot-word {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 55%, #d9dbe0 100%);
  border-radius: 12px;
  box-shadow: 0 2px 0 rgba(11, 26, 46, 0.35), 0 10px 22px -12px rgba(0, 0, 0, 0.7);
}

.foot-word img {
  display: block;
  width: auto;
  height: 44px;
}

@media (max-width: 960px) {
  .site-header .wrap {
    grid-template-columns: 1fr;
  }

  .brand__text {
    display: flex;
  }
}

@media (max-width: 960px) {
  .site-header .brand {
    justify-content: flex-start;
    justify-self: start;
  }
}

/* Tagline sits under the monogram, centred on it. */
.site-header .brand {
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.site-header .wrap {
  padding-block: 0.6rem 0.55rem;
}

.site-header .brand img.brand__mark {
  width: 50px;
  height: 50px;
  padding: 6px;
}

.brand__text {
  display: block;
  text-align: center;
}

.brand__tag {
  display: block;
  margin: 0;
  font-size: 0.56rem;
  line-height: 1;
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(60, 20, 0, 0.55);
}

@media (max-width: 960px) {
  .site-header .brand {
    align-items: flex-start;
  }

  .brand__text {
    display: block;
    text-align: left;
  }

  .brand__tag {
    display: block;
  }

  .site-header .brand img.brand__mark {
    width: 42px;
    height: 42px;
    padding: 5px;
  }
}

/* Tagline beside the monogram, visible at every screen size. */
.site-header .brand,
.site-header .brand:link {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 0.7rem;
}

.site-header .brand img.brand__mark {
  width: 52px;
  height: 52px;
  padding: 6px;
  flex: 0 0 auto;
}

.site-header .brand .brand__text {
  display: block;
  text-align: left;
}

.site-header .brand .brand__tag {
  display: block;
  font-size: 0.74rem;
  line-height: 1.3;
  letter-spacing: 0.2em;
  white-space: nowrap;
  color: #fff4ea;
}

@media (max-width: 960px) {
  .site-header .brand img.brand__mark {
    width: 44px;
    height: 44px;
    padding: 5px;
  }

  .site-header .brand .brand__tag {
    font-size: 0.68rem;
  }
}

@media (max-width: 380px) {
  .site-header .brand .brand__tag {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }
}


/* Faded wordmark watermark behind the hero content. */
.home-hero::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 33%;
  width: min(110vw, 1040px);
  aspect-ratio: 1886 / 514;
  transform: translate(-50%, -50%);
  background: url('/logo-wordmark.webp') center / contain no-repeat;
  opacity: 0.14;
  filter: saturate(0.8);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 100%);
  pointer-events: none;
}

.home-hero .wrap {
  z-index: 1;
}

/* The hero runs up under the header's curved corners, so no blank gap shows. */
main:has(> .home-hero) {
  margin-top: -44px;
}

main > .home-hero {
  padding-top: calc(clamp(3rem, 8vw, 6rem) + 44px);
}

@media (max-width: 720px) {
  main:has(> .home-hero) {
    margin-top: -28px;
  }

  main > .home-hero {
    padding-top: calc(clamp(3rem, 8vw, 6rem) + 28px);
  }
}

/* Watermark wordmark above the "Legal document templates" label, clearly visible. */
.home-hero {
  --wm-w: min(78vw, 600px);
  --wm-top: 100px;
}

.home-hero::after {
  top: var(--wm-top);
  width: var(--wm-w);
  transform: translateX(-50%);
  opacity: 0.4;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
}

main > .home-hero {
  padding-top: calc(var(--wm-top) + var(--wm-w) * 0.2725 + 2rem);
}

@media (max-width: 960px) {
  .home-hero {
    --wm-top: 140px;
  }
}

/* Watermark: fainter, with half the space above and below. */
.home-hero {
  --wm-top: 60px;
}

.home-hero::after {
  opacity: 0.17;
}

main > .home-hero {
  padding-top: calc(var(--wm-top) + var(--wm-w) * 0.2725 + 1rem);
}

@media (max-width: 960px) {
  .home-hero {
    --wm-top: 95px;
  }
}

/* Watermark at half size. */
.home-hero {
  --wm-w: min(39vw, 300px);
  --wm-top: 80px;
}

@media (max-width: 960px) {
  .home-hero {
    --wm-top: 125px;
    --wm-w: min(55vw, 300px);
  }
}

/* Wordmark tucked up under the header; the label and headline stay where they were. */
.home-hero {
  --wm-top: 38px;
}

main > .home-hero {
  padding-top: calc(80px + var(--wm-w) * 0.2725 + 1rem);
}

@media (max-width: 960px) {
  .home-hero {
    --wm-top: 44px;
  }

  main > .home-hero {
    padding-top: calc(125px + var(--wm-w) * 0.2725 + 1rem);
  }
}

/* No gap under the wordmark: the label follows straight after it. */
main > .home-hero,
main > .home-hero:first-child {
  padding-top: calc(var(--wm-top) + var(--wm-w) * 0.2725 + 0.25rem);
}

@media (max-width: 960px) {
  main > .home-hero {
    padding-top: calc(var(--wm-top) + var(--wm-w) * 0.2725 + 0.25rem);
  }
}

@media (max-width: 960px) {
  main > .home-hero {
    padding-top: calc(var(--wm-top) + var(--wm-w) * 0.2725 + 1.1rem);
  }
}

/* Watermark 40% more visible (0.17 to 0.24). */
.home-hero::after {
  opacity: 0.24;
}

/* Watermark opacity 50%. */
.home-hero::after {
  opacity: 0.5;
}

/* Accessibility: navy text on the orange bar (5.2:1 at the nav, white was 3.4:1). */
.site-header .site-nav a,
.site-header .site-nav a:hover {
  color: #0b1a2e;
  text-shadow: 0 1px 0 rgba(255, 220, 190, 0.35);
}

.site-header .site-nav a[aria-current='page'] {
  color: #fff;
  text-shadow: none;
}

.site-header .brand .brand__tag {
  color: #0b1a2e;
  text-shadow: 0 1px 0 rgba(255, 220, 190, 0.35);
}

/* Footer links: at least 24px tall touch targets (WCAG 2.2). */
.foot-links a {
  display: inline-block;
  padding-block: 0.3rem;
}

/* Header tagline in Pactum Notch, same as the footer tagline. */
.site-header .brand .brand__tag {
  font-family: var(--pactum);
  font-weight: 400;
  font-size: 0.86rem;
  letter-spacing: 0.24em;
}

@media (max-width: 380px) {
  .site-header .brand .brand__tag {
    font-size: 0.74rem;
    letter-spacing: 0.18em;
  }
}

.site-header .brand .brand__tag {
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: 0.2em;
}

.site-footer { margin-top: 0; }
body { display: block; }
