/* ==========================================================================
   Gundlach's Service - design system
   Palette + type from Brand Profile v4 (gundlach-book-4-final.pdf, 2026-08-03).
   Layout vocabulary ported from the approved microsite prototype.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Primary */
  --joust-red: #C40215;
  --joust-red-dark: #9C0210;
  --goblet-gold: #EE8C1E;
  --big-top-blue: #09549E;

  /* Secondary */
  --slate-blue: #1D3545;
  --charcoal: #191918;
  --duct-gray: #9F9FA0;
  --swiss-coffee: #F9EFE6;

  /* Derived neutrals */
  --ink: var(--charcoal);
  --ink-soft: #55565A;        /* 7.33:1 on white - the lightest text colour allowed */
  --rule: rgba(25, 25, 24, .13);
  --rule-strong: rgba(25, 25, 24, .34);   /* 3:1+ so input borders are visible */
  --paper: #FFFFFF;
  --wash: #F2F2F1;            /* neutral hover/zebra tint, never a section fill */

  /* Type ------------------------------------------------------------------
     One modular scale, ratio 1.25 throughout. Every adjacent step is a full
     quarter apart, so hierarchy reads without relying on colour or rules.
     Headings are fluid; body and anything below it is fixed. */
  --font-head: 'Besley', 'Century Schoolbook', Georgia, serif;
  --font-body: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-display: clamp(2.75rem, 1.9rem + 4.2vw, 4.769rem);  /*  44 -> 76 */
  --text-h1:      clamp(2.441rem, 1.8rem + 3.2vw, 3.815rem); /*  39 -> 61 */
  --text-h2:      clamp(1.953rem, 1.5rem + 2.2vw, 3.052rem); /*  31 -> 49 */
  --text-h3:      1.5625rem;                                 /*  25 */
  --text-lede:    1.25rem;                                   /*  20 */
  --text-body:    1rem;                                      /*  16 */
  --text-label:   .8rem;                                     /*  12.8 */

  /* Weights. 500 and 600 are indistinguishable in Libre Franklin at UI sizes,
     so the system ships four steps and never both. */
  --weight-body: 400;
  --weight-semi: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* Leading. Display type wants to sit tight; small headings wrap and must not. */
  --leading-display: 1.04;
  --leading-heading: 1.25;
  --leading-body: 1.6;
  --leading-prose: 1.7;

  /* Tracking. One value for every uppercase micro-label on the site. */
  --track-label: .14em;
  --track-display: -.02em;

  /* Space */
  --gutter: clamp(1.25rem, .6rem + 2.4vw, 3rem);
  --band: clamp(3rem, 2rem + 4vw, 4.5rem);
  --shell: 1360px;
  --shell-narrow: 1160px;
  --prose: 68ch;

  --radius: 6px;
  --radius-sm: 3px;
  --shadow-card: 0 12px 28px rgba(29, 53, 69, .14);
  --shadow-raised: 0 8px 30px rgba(29, 53, 69, .12);

  --speed: .2s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  font-synthesis: none;              /* never fake a weight we do not ship */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  margin: 0;
  text-wrap: balance;          /* even line lengths on headings */
  letter-spacing: 0;
}

/* Only display-scale type gets optical tightening; small headings want none. */
.hero h1, .section-head h2, .cg-band h2, .split h2 {
  line-height: var(--leading-display);
  letter-spacing: var(--track-display);
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--joust-red); text-decoration: none; transition: color var(--speed); }
a:hover { color: var(--joust-red-dark); }

:focus-visible {
  outline: 3px solid var(--big-top-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Layout primitives -------------------------------------------------- */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.shell--narrow { max-width: var(--shell-narrow); }

.band { padding-block: var(--band); }
.band--tight { padding-block: calc(var(--band) * .72); }

.band--cream    { background: var(--paper); }
.band--paper    { background: var(--paper); }
.band--alt      { background: var(--paper); border-block: 1px solid var(--rule); }
.band--slate    { background: var(--slate-blue); color: var(--swiss-coffee); }
.band--charcoal { background: var(--charcoal); color: var(--swiss-coffee); }

.band--slate h1, .band--slate h2, .band--slate h3,
.band--charcoal h1, .band--charcoal h2, .band--charcoal h3 { color: var(--swiss-coffee); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--joust-red); color: #fff; padding: 12px 20px;
  font-weight: var(--weight-bold); border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* --- Section heading ---------------------------------------------------- */
.kicker {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--joust-red);
  margin-bottom: 12px;
}
.band--slate .kicker, .band--charcoal .kicker, .cg-band .kicker, .hero .kicker { color: var(--goblet-gold); }

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--text-h2); }
.section-head p {
  font-size: var(--text-lede);
  color: var(--ink-soft);
  margin-top: 14px;
  line-height: 1.6;
}
.band--slate .section-head p, .band--charcoal .section-head p { color: rgba(249, 239, 230, .82); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-body);
  line-height: 1.2;
  padding: 16px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: background var(--speed), color var(--speed), border-color var(--speed), transform var(--speed), box-shadow var(--speed);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--joust-red); color: #fff;
  box-shadow: 0 3px 10px rgba(196, 2, 21, .28);
}
.btn--primary:hover { background: var(--joust-red-dark); color: #fff; box-shadow: 0 5px 16px rgba(196, 2, 21, .34); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { color: var(--joust-red); border-color: var(--joust-red); }

.btn--onDark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn--onDark:hover { color: var(--goblet-gold); border-color: var(--goblet-gold); }

.btn--gold { background: var(--goblet-gold); color: var(--charcoal); }
.btn--gold:hover { background: #d97c15; color: var(--charcoal); }

.btn--sm { font-size: var(--text-body); padding: 12px 22px; }

.arrow-link { font-weight: var(--weight-bold); font-size: var(--text-body); color: var(--joust-red); display: inline-flex; align-items: center; gap: 7px; }
.arrow-link::after { content: '\2192'; transition: transform var(--speed); }
.arrow-link:hover::after { transform: translateX(3px); }
.band--slate .arrow-link, .band--charcoal .arrow-link, .cg-band .arrow-link { color: var(--goblet-gold); }
.band--slate .arrow-link:hover, .band--charcoal .arrow-link:hover, .cg-band .arrow-link:hover { color: #fff; }

/* --- Utility bar -------------------------------------------------------- */
.utility {
  background: var(--slate-blue);
  color: var(--swiss-coffee);
  font-size: var(--text-label);
  font-weight: var(--weight-semi);
}
.utility .shell {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding-block: 9px; flex-wrap: wrap;
}
.utility__group { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.utility__accent { color: var(--goblet-gold); }
.utility__phone { color: #fff; font-weight: var(--weight-bold); letter-spacing: .02em; }
.utility__phone:hover { color: var(--goblet-gold); }

/* --- Masthead ----------------------------------------------------------- */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 60;
}
.masthead .shell {
  display: flex; align-items: center; gap: 32px;
  min-height: 92px;
}
.masthead__logo { flex: none; line-height: 0; }
.masthead__logo img { height: 64px; width: auto; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-body); font-weight: var(--weight-semi); color: var(--ink);
  padding: 8px 0; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav__link:hover, .nav__item[data-open="true"] > .nav__link { color: var(--joust-red); border-bottom-color: var(--joust-red); }
.nav__link[aria-current="page"] { color: var(--joust-red); border-bottom-color: var(--joust-red); }
.nav__caret { width: 9px; height: 9px; fill: currentColor; transition: transform var(--speed); }
.nav__item[data-open="true"] .nav__caret { transform: rotate(180deg); }

.nav__panel {
  position: absolute; top: calc(100% + 10px); left: -20px;
  min-width: 268px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 10px;
  list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--speed), transform var(--speed), visibility var(--speed);
}
.nav__item[data-open="true"] .nav__panel { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__panel a {
  display: block; padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: var(--text-body); font-weight: var(--weight-semi); color: var(--ink);
}
.nav__panel a:hover { background: var(--wash); color: var(--joust-red); }
.nav__panel-head {
  font-family: var(--font-body);
  font-size: var(--text-label); font-weight: var(--weight-bold); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-soft); padding: 12px 14px 6px;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--joust-red); border-radius: 2px; transition: transform var(--speed), opacity var(--speed); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* --- Hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--slate-blue); isolation: isolate; }
.hero__media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: right top;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right,
      rgba(20, 32, 44, .90) 0%, rgba(20, 32, 44, .80) 38%,
      rgba(20, 32, 44, .48) 62%, rgba(20, 32, 44, .10) 84%,
      rgba(20, 32, 44, 0) 100%),
    linear-gradient(rgba(20, 32, 44, .26), rgba(20, 32, 44, .26));
}
.hero__inner { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); max-width: 640px; }
.hero .kicker { color: var(--goblet-gold); }
/* Filled rather than outlined: the campaign line has to stay legible over an
   arbitrary post photograph, so it carries its own ground instead of borrowing
   the image's. */
.hero__badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(25, 25, 24, .88);
  color: var(--goblet-gold);
  font-size: var(--text-label); font-weight: var(--weight-bold);
  letter-spacing: var(--track-label); text-transform: uppercase;
  padding: 8px 15px; border-radius: var(--radius-sm); margin-bottom: 22px;
}
.hero h1 { font-size: var(--text-display); color: #fff; margin-bottom: 20px; }
.hero__lede {
  font-size: var(--text-lede); line-height: 1.62;
  color: rgba(255, 255, 255, .9); margin-bottom: 32px; max-width: 52ch;
}
.hero__actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero__points {
  display: flex; gap: 26px; margin-top: 40px; flex-wrap: wrap;
  font-size: var(--text-body); font-weight: var(--weight-semi); color: rgba(255, 255, 255, .92);
}
.hero__points span { display: flex; align-items: center; gap: 8px; }
.hero__points span::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--goblet-gold); flex: none;
}

/* Compact hero for interior/blog pages */
.hero--compact .hero__inner { padding-block: clamp(2.75rem, 1.8rem + 3.6vw, 4.25rem); max-width: 720px; }
.hero--compact h1 { font-size: var(--text-h1); }

.breadcrumb { font-size: var(--text-label); color: rgba(255, 255, 255, .72); margin-bottom: 16px; }
.breadcrumb a { color: rgba(255, 255, 255, .72); }
.breadcrumb a:hover { color: var(--goblet-gold); }
.breadcrumb span { margin-inline: 8px; opacity: .5; }

/* --- Promise bar -------------------------------------------------------- */
.promise {
  background: var(--joust-red); color: var(--swiss-coffee);
}
.promise .shell {
  display: flex; justify-content: center; gap: clamp(1.5rem, .5rem + 3vw, 3.5rem);
  padding-block: 18px; flex-wrap: wrap;
  font-size: var(--text-body); font-weight: var(--weight-semi); letter-spacing: .04em;
}

/* --- Trust / stat bar --------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stats--three { grid-template-columns: repeat(3, 1fr); }
.stat { text-align: center; padding-inline: 12px; }
.stat + .stat { border-left: 1px solid var(--rule); }
.band--slate .stat + .stat, .band--charcoal .stat + .stat { border-left-color: rgba(249, 239, 230, .18); }
.stat__figure {
  font-family: var(--font-head); font-weight: var(--weight-black); line-height: 1;
  font-size: var(--text-h2);
  color: var(--joust-red);
}
.band--slate .stat__figure, .band--charcoal .stat__figure { color: var(--goblet-gold); }
.stat__label { font-size: var(--text-label); font-weight: var(--weight-semi); color: var(--ink-soft); margin-top: 8px; line-height: 1.35; }
.band--slate .stat__label, .band--charcoal .stat__label { color: rgba(249, 239, 230, .85); }
.stat-note { text-align: center; margin-top: 20px; font-size: var(--text-label); color: rgba(249, 239, 230, .6); }

.trust-bar { background: var(--paper); border-block: 1px solid var(--rule); }
.trust-bar .shell { padding-block: 26px; }

/* --- Card grids --------------------------------------------------------- */
.grid { display: grid; gap: 26px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: box-shadow var(--speed), transform var(--speed), border-color var(--speed);
}
a.card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
  border-color: rgba(25, 25, 24, .2);
  color: inherit;
}
.card__media { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: var(--paper); }
.card__media--wide { aspect-ratio: 16 / 10; }
.card__body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__body h3 { font-size: var(--text-h3); }
.card__body p { font-size: var(--text-body); line-height: 1.55; color: var(--ink-soft); }
.card__body .arrow-link { margin-top: auto; padding-top: 6px; }

/* Pillar card: icon beside copy */
.pillar {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 30px;
  transition: box-shadow var(--speed);
}
.pillar:hover { box-shadow: var(--shadow-card); }
.pillar__icon { height: 68px; width: auto; flex: none; object-fit: contain; }
.pillar h3 { font-size: var(--text-h3); margin-bottom: 8px; }
.pillar p { font-size: var(--text-body); line-height: 1.6; color: var(--ink-soft); }

/* Link list card (service directories) */
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.linklist a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-weight: var(--weight-semi); font-size: var(--text-body);
  transition: border-color var(--speed), background var(--speed), color var(--speed);
}
.linklist a:hover { border-color: var(--joust-red); color: var(--joust-red); background: #fff; }
.linklist a::after { content: '\2192'; color: var(--ink-soft); }
.linklist a:hover::after { color: var(--joust-red); }

/* --- Testimonials -------------------------------------------------------- */
.quote {
  margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 30px 32px;
}
.quote__mark { width: 30px; height: 22px; fill: var(--goblet-gold); flex: none; }
.quote blockquote { margin: 0; }
.quote__headline {
  font-family: var(--font-head); font-weight: var(--weight-bold);
  font-size: var(--text-body); line-height: 1.3; color: var(--ink); margin-bottom: 10px;
}
.quote__body { font-size: var(--text-body); line-height: 1.6; color: var(--ink-soft); }
.quote__name {
  margin-top: auto; padding-top: 8px;
  font-size: var(--text-label); font-weight: var(--weight-bold); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--slate-blue);
}

/* --- Credential badges --------------------------------------------------- */
.badges {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem); flex-wrap: wrap;
}
/* Legacy badge rasters vary wildly in aspect and padding, so normalise the
   optical height rather than trusting each file's own dimensions. */
.badges img { height: 92px; width: auto; max-width: 220px; object-fit: contain; margin-inline: auto; }
.badges figure { margin: 0; text-align: center; }
.badges figcaption {
  font-size: var(--text-label); font-weight: var(--weight-bold); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-soft); margin-top: 12px;
}

/* --- CastleGuard band --------------------------------------------------- */
.cg-band { background: var(--charcoal); color: var(--swiss-coffee); }
.cg-band .shell {
  display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: center;
  padding-block: var(--band);
}
.cg-band h2 { font-size: var(--text-h2); margin-bottom: 16px; }
.cg-band p { font-size: var(--text-body); line-height: 1.65; color: rgba(249, 239, 230, .82); margin-bottom: 22px; max-width: 62ch; }
.cg-band img { width: 100%; }

/* --- Split (copy + media / copy + form) --------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: center; }
.split--media-first > :first-child { order: 2; }
.split h2 { font-size: var(--text-h2); margin-bottom: 14px; }
.split p { font-size: var(--text-body); line-height: 1.65; color: var(--ink-soft); }
.split__figure { border-radius: var(--radius); overflow: hidden; }
.split__figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.phone-cta {
  font-family: var(--font-head); font-weight: var(--weight-black);
  font-size: var(--text-h3);
  color: var(--joust-red); display: inline-block; margin-top: 20px;
}
.phone-cta:hover { color: var(--joust-red-dark); }
.phone-note { font-size: var(--text-body); font-weight: var(--weight-semi); color: var(--slate-blue); margin-top: 6px; }

/* --- Forms -------------------------------------------------------------- */
.form-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-raised);
  padding: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
}
.form-card h2 { font-size: var(--text-h2); text-align: center; }
.form-card > p { font-size: var(--text-body); color: var(--ink-soft); text-align: center; margin: 8px 0 28px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--text-label); font-weight: var(--weight-bold); color: var(--ink); letter-spacing: .01em; }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: var(--text-body);
  padding: 13px 15px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
  transition: border-color var(--speed), box-shadow var(--speed);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--joust-red);
  box-shadow: 0 0 0 3px rgba(196, 2, 21, .14);
}
.field textarea { resize: vertical; min-height: 110px; }
.field__error { font-size: var(--text-label); font-weight: var(--weight-semi); color: var(--joust-red); }
.field[data-invalid="true"] input, .field[data-invalid="true"] select { border-color: var(--joust-red); }

.form-note { font-size: var(--text-label); color: var(--ink-soft); text-align: center; margin-top: 14px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { text-align: center; padding: 24px 0 8px; }
.form-success__mark {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--slate-blue); color: var(--goblet-gold);
  font-size: var(--text-h3); line-height: 56px; margin: 0 auto 16px;
}
.form-success h3 { font-size: var(--text-h3); margin-bottom: 6px; }
.form-success p { font-size: var(--text-body); color: var(--ink-soft); }

/* --- Prose (migrated page + post bodies) -------------------------------- */
.prose {
  max-width: var(--prose);
  font-size: var(--text-body);
  line-height: var(--leading-prose);
  color: #2E2F31;
}
/* Long compound tokens ("replacement/installation") must break, not overflow. */
.prose h2, .prose h3, .prose h4 { overflow-wrap: break-word; hyphens: auto; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: var(--text-h2);
  margin-top: 2em; margin-bottom: .1em; color: var(--ink);
  padding-top: .6em; border-top: 1px solid var(--rule);
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: var(--text-h3); margin-top: 1.8em; margin-bottom: .05em; color: var(--slate-blue); }
.prose h4 {
  font-size: var(--text-lede);
  margin-top: 1.6em; margin-bottom: .05em;
  font-family: var(--font-head); font-weight: var(--weight-bold);
}
/* Migrated WordPress copy contains a handful of h5/h6. Without these they fall
   to UA defaults and render smaller than the body text around them. */
.prose h5, .prose h6 {
  font-size: var(--text-body);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  text-transform: none;
  margin-top: 1.5em; margin-bottom: .05em;
  color: var(--ink);
}
.prose h5 b, .prose h6 b { font-weight: inherit; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--joust-red); }
.prose a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose strong { font-weight: var(--weight-bold); color: var(--ink); }
.prose img { border-radius: var(--radius); margin-block: 1.6em; }
.prose blockquote {
  margin: 2em 0; padding: 0;
  font-family: var(--font-head);
  font-size: var(--text-h3);
  line-height: 1.35;
  color: var(--slate-blue);
  text-wrap: balance;
}
.prose blockquote p { margin: 0; }
.prose blockquote::before {
  content: ''; display: block;
  width: 3rem; height: 2px; margin-bottom: .8em;
  background: var(--goblet-gold);
}
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
.prose th { background: var(--wash); font-weight: var(--weight-bold); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.4em; }

/* Page layout with sidebar */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: start; }
.aside { position: sticky; top: 116px; display: grid; gap: 20px; }
.aside__card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); padding: 24px 26px;
}
.aside__card--plain { background: var(--paper); }
.aside__card h3 { font-size: var(--text-lede); margin-bottom: 10px; }

.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block; padding: 8px 0;
  font-size: var(--text-body); font-weight: var(--weight-semi); line-height: 1.4;
  color: var(--ink); border-left: 0;
}
.toc a:hover { color: var(--joust-red); }
.aside__card p { font-size: var(--text-body); line-height: 1.6; color: var(--ink-soft); margin-bottom: 16px; }
.aside__card .btn { width: 100%; }

/* --- Blog --------------------------------------------------------------- */
.post-meta { display: flex; align-items: center; gap: 12px; font-size: var(--text-label); color: var(--ink-soft); flex-wrap: wrap; }
.tag {
  display: inline-block; font-size: var(--text-label); font-weight: var(--weight-bold);
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--joust-red); background: rgba(196, 2, 21, .08);
  padding: 5px 10px; border-radius: 999px;
}
.tag--muted { color: var(--slate-blue); background: rgba(29, 53, 69, .08); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filters a {
  font-size: var(--text-body); font-weight: var(--weight-semi); color: var(--ink);
  padding: 9px 16px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper); transition: all var(--speed);
}
.filters a:hover { border-color: var(--joust-red); color: var(--joust-red); }
.filters a[aria-current="true"] { background: var(--joust-red); border-color: var(--joust-red); color: #fff; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; padding-inline: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  font-size: var(--text-body); font-weight: var(--weight-semi); color: var(--ink);
}
.pagination a:hover { border-color: var(--joust-red); color: var(--joust-red); }
.pagination [aria-current="page"] { background: var(--joust-red); border-color: var(--joust-red); color: #fff; }
.pagination .is-gap { border: 0; min-width: 20px; color: var(--ink-soft); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 56px; }
.post-nav a {
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 24px;
  color: var(--ink); transition: border-color var(--speed), box-shadow var(--speed);
}
.post-nav a:hover { border-color: var(--joust-red); box-shadow: var(--shadow-card); }
.post-nav small { display: block; font-size: var(--text-label); font-weight: var(--weight-bold); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.post-nav strong { font-family: var(--font-head); font-size: var(--text-body); font-weight: var(--weight-bold); line-height: 1.3; }
.post-nav a:last-child { text-align: right; }

/* --- Footer ------------------------------------------------------------- */
.footer { background: var(--charcoal); color: rgba(249, 239, 230, .72); font-size: var(--text-body); }
.footer a { color: rgba(249, 239, 230, .72); }
.footer a:hover { color: var(--goblet-gold); }
.footer__top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-block: clamp(2.5rem, 1.8rem + 2.4vw, 3.5rem);
}
.footer__brand img { height: 22px; width: auto; margin-bottom: 16px; }
.footer__brand p { font-size: var(--text-body); line-height: 1.65; margin-bottom: 18px; max-width: 34ch; }
.footer__phone {
  font-family: var(--font-head); font-weight: var(--weight-black); font-size: var(--text-h3);
  color: var(--goblet-gold); display: inline-block;
}
.footer__phone:hover { color: #fff; }
/* Semantically an <h2> so the document outline never skips a level; sized as a
   small label because that is its role in the footer. */
.footer__heading {
  font-family: var(--font-body); font-size: var(--text-label); font-weight: var(--weight-bold);
  letter-spacing: var(--track-label); text-transform: uppercase; line-height: 1.4;
  color: var(--goblet-gold); margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer__bottom {
  border-top: 1px solid rgba(249, 239, 230, .14);
  padding-block: 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: var(--text-label);
}
.footer__tagline { color: var(--goblet-gold); font-weight: var(--weight-semi); }

/* --- Sticky mobile call bar --------------------------------------------- */
.callbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: var(--joust-red);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, .22);
}
.callbar a {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px; color: #fff; font-weight: var(--weight-bold); font-size: var(--text-body);
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .cg-band .shell { grid-template-columns: 1fr 300px; }
  .with-aside { grid-template-columns: 1fr; }
  .aside { position: static; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .split { grid-template-columns: 1fr; }
  .split--media-first > :first-child { order: 0; }
  .cg-band .shell { grid-template-columns: 1fr; }
  .cg-band img { max-width: 320px; }
}

@media (max-width: 768px) {
  html { scroll-padding-top: 80px; }

  .masthead .shell { min-height: 72px; }
  .masthead__logo img { height: 48px; }
  .nav-toggle { display: flex; }

  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 24px;
    max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .nav[data-open="true"] { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { padding: 14px 0; border-bottom: 1px solid var(--rule); justify-content: space-between; }
  .nav__link:hover, .nav__link[aria-current="page"] { border-bottom-color: var(--rule); }
  .nav__panel {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-radius: 0;
    padding: 4px 0 10px 14px; min-width: 0;
    display: none;
  }
  .nav__item[data-open="true"] .nav__panel { display: block; }
  .nav__panel-head { padding: 10px 14px 4px; }
  .nav > .btn { margin-top: 16px; }

  .utility { font-size: var(--text-label); }
  .utility .shell { justify-content: center; padding-block: 8px; }
  .utility__group:first-child { display: none; }

  .hero__media { object-position: center top; }
  .hero__scrim {
    background: linear-gradient(to bottom,
      rgba(20, 32, 44, .74) 0%, rgba(20, 32, 44, .80) 45%, rgba(20, 32, 44, .92) 100%);
  }
  .hero__inner { max-width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; }

  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--rule); }
  .band--slate .stat:nth-child(even) { border-left-color: rgba(249, 239, 230, .18); }

  .form-grid { grid-template-columns: 1fr; }
  .aside { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a:last-child { text-align: left; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }

  .callbar { display: block; }
  body { padding-bottom: 54px; }
}

@media print {
  .utility, .masthead, .callbar, .footer__top, .aside, .hero__media, .hero__scrim { display: none !important; }
  body { padding-bottom: 0; }
  .hero { background: none; color: #000; }
  .hero h1, .hero__lede { color: #000; }
}


/* --- Extracted from template inline styles ------------------------------- */
/* Contact detail list. Was five copy-pasted inline dt/dd blocks. */
.spec-list { margin: 32px 0 0; display: grid; gap: 18px; }
.spec-list dt {
  font-size: var(--text-label); font-weight: var(--weight-bold);
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 4px;
}
.spec-list dd { margin: 0; font-size: var(--text-body); }

/* Purpose / Mission / Vision. Was three identical inline h3 + p pairs. */
.pmv h3 { color: var(--goblet-gold); font-size: var(--text-lede); margin-bottom: 10px; }
.pmv p  { color: rgba(249, 239, 230, .85); line-height: var(--leading-body); }

.figure-caption { font-size: var(--text-label); color: var(--ink-soft); padding-top: 10px; }
.result-count   { font-size: var(--text-label); color: var(--ink-soft); margin-bottom: 24px; }
.field-optional { font-weight: var(--weight-body); color: var(--ink-soft); }

/* Licence mark in the credentials strip. Was an inline copy of .stat__figure. */
.license-mark {
  font-family: var(--font-head); font-weight: var(--weight-black);
  font-size: var(--text-h3); color: var(--joust-red); line-height: 1;
}

/* Proof-point list on the CastleGuard page. Was a full inline card treatment. */
.proof-item {
  display: block; padding: 14px 18px;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--paper); font-weight: var(--weight-semi); font-size: var(--text-body);
}

.phone-cta--sm { font-size: var(--text-h3); margin-top: 0; }
