/*
Theme Name: TCM Pro
Theme URI: https://tcmpro.co.uk
Author: Benet Thomas
Description: Standalone theme for TCM Pro, a UK COTC / WAMITAB technically competent manager cover service. Industrial regulatory identity. Templates for homepage, COTC service pages and contact.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: Proprietary
Text Domain: tcmpro
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Core palette. Steel navy + hi-vis amber, drawn from site PPE and permit signage. */
  --ink:         #101A26;
  --ink-90:      #1B2836;
  --ink-70:      #2E3E4F;
  --steel:       #5C6B7A;
  --steel-light: #93A1AD;
  --hairline:    #D8D4CB;

  --paper:       #F4F2ED;
  --paper-warm:  #EDEAE2;
  --white:       #FFFFFF;

  --amber:       #FFB020;
  --amber-deep:  #E09000;
  --amber-wash:  #FFF4DE;

  --signal:      #D6402C;
  --signal-wash: #FBEAE7;
  --go:          #1F7A5C;

  /* Type */
  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* Scale, fluid */
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.24vw, 1.13rem);
  --step-1:  clamp(1.2rem, 1.11rem + 0.44vw, 1.47rem);
  --step-2:  clamp(1.44rem, 1.29rem + 0.74vw, 1.91rem);
  --step-3:  clamp(1.73rem, 1.49rem + 1.18vw, 2.48rem);
  --step-4:  clamp(2.07rem, 1.71rem + 1.81vw, 3.22rem);
  --step-5:  clamp(2.49rem, 1.94rem + 2.71vw, 4.19rem);

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  --wrap: 1180px;
  --wrap-tight: 760px;

  --radius: 3px;
  --shadow-low: 0 1px 2px rgba(16, 26, 38, 0.06), 0 2px 8px rgba(16, 26, 38, 0.04);
  --shadow-mid: 0 2px 4px rgba(16, 26, 38, 0.08), 0 12px 28px rgba(16, 26, 38, 0.10);
  --shadow-high: 0 4px 8px rgba(16, 26, 38, 0.10), 0 24px 56px rgba(16, 26, 38, 0.16);
}

/* Hazard striping. The signature device, used as rules and accents. */
.hazard-rule {
  height: 6px;
  border: 0;
  margin: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--amber) 0 10px,
    var(--ink) 10px 20px
  );
}
.hazard-rule--thin { height: 4px; }

/* ==========================================================================
   2. Reset and base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

a { color: var(--ink); text-decoration-color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--amber); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: var(--sp-3) var(--sp-4);
  z-index: 999;
}
.skip-link:focus { left: 0; }

.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}
.wrap--tight { width: min(100% - 2.5rem, var(--wrap-tight)); }

/* scroll-margin so in-page anchors (e.g. #how-it-works) clear the sticky header. */
.section { padding-block: var(--sp-9); scroll-margin-top: 5.5rem; }
.section--tight { padding-block: var(--sp-7); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink h2, .section--ink h3 { color: var(--white); }
.section--warm { background: var(--paper-warm); }

/* Eyebrow label. Mono, uppercase, amber tick. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  background: var(--amber);
  flex: none;
}
.section--ink .eyebrow { color: var(--amber); }
.section--ink .eyebrow::before { background: var(--amber); }

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  padding: var(--sp-4) var(--sp-6);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}
.btn--primary {
  background: var(--amber);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn--primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--amber-deep);
}
.btn--primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--white); }

/* Ghost buttons invert on every dark surface. .hero must be listed here: it is
   ink-backed but does not carry .section--ink, so without this the button
   renders ink-on-ink and is completely invisible. */
.section--ink .btn--ghost,
.hero .btn--ghost {
  color: var(--paper);
  border-color: var(--paper);
}
.section--ink .btn--ghost:hover,
.hero .btn--ghost:hover { background: var(--paper); color: var(--ink); }

/* Phone link, mono treatment */
.tel-link {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--step-1);
  text-decoration: none;
  white-space: nowrap;
}

/* ==========================================================================
   5. Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-block: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: -0.03em;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
}
.brand__mark {
  color: var(--ink);
  background: var(--amber);
  padding: 0.1em 0.34em;
  border-radius: 2px;
}
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: var(--sp-6); }
.nav ul { display: flex; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.nav a {
  color: var(--paper);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-block: var(--sp-2);
  border-bottom: 2px solid transparent;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.nav a:hover, .nav .current-menu-item > a {
  border-bottom-color: var(--amber);
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--steel);
  color: var(--paper);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--ink-90);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-5);
    gap: var(--sp-4);
    border-top: 3px solid var(--amber);
  }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: var(--sp-4); }
  .nav .btn { justify-content: center; }
}

/* ==========================================================================
   6. Hero
   ========================================================================== */

.hero {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-9) var(--sp-10);
}
/* Blueprint grid atmosphere */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 176, 32, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 176, 32, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  /* minmax(0, Nfr) not Nfr: a bare fr floors at min-content, so one long
     unbreakable heading can blow the column out and crush the sibling. */
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: center;
}
.hero__inner > * { min-width: 0; }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--sp-7); }
}

.hero h1 { color: var(--white); margin-bottom: var(--sp-5); }
/* Amber emphasis on the key phrase. Deliberately allowed to wrap: the phrase
   is too long to keep on one line without wrecking the grid. */
.hero h1 em {
  font-style: normal;
  color: var(--amber);
  position: relative;
}
.hero__lede {
  font-size: var(--step-1);
  color: var(--steel-light);
  max-width: 44ch;
  margin-bottom: var(--sp-6);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }

/* Hero stat card. The 20% rule is the whole reason the buyer is here. */
.stat-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-high);
  transform: rotate(-1.1deg);
}
.stat-card__body { padding: var(--sp-6); }
.stat-card__figure {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 3rem + 5vw, 6.5rem);
  line-height: 0.85;
  letter-spacing: -0.05em;
  margin-bottom: var(--sp-4);
}
.stat-card__figure span { color: var(--amber-deep); }
.stat-card__label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel);
  margin-bottom: var(--sp-3);
}
.stat-card__note { font-size: var(--step--1); color: var(--ink-70); margin: 0; }
.stat-card__cite {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel);
}

/* ==========================================================================
   7. Enforcement / alert band
   ========================================================================== */

.alert-band {
  background: var(--signal-wash);
  border-block: 2px solid var(--signal);
  padding-block: var(--sp-5);
}
.alert-band__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.alert-band__icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--signal);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: 50%;
}
.alert-band p { font-size: var(--step--1); color: var(--ink); margin: 0; }
.alert-band strong { font-weight: 700; }

/* ==========================================================================
   8. Cards / service grid
   ========================================================================== */

.grid { display: grid; gap: var(--sp-5); }
/* minmax(0, 1fr) throughout so long words or wide children cannot force a
   column past its share and push the row out of the viewport. */
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
@media (max-width: 900px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-mid);
  border-color: var(--steel-light);
}
.card:hover::before { transform: scaleX(1); }
.card h3 { margin-bottom: 0; }
.card p { font-size: var(--step--1); color: var(--ink-70); }

.card__index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--amber-deep);
  letter-spacing: 0.08em;
}
.card__link {
  margin-top: auto;
  padding-top: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.card__link::after { content: "\2192"; transition: transform 0.16s ease; }
.card:hover .card__link::after { transform: translateX(4px); }
/* Whole-card click target without trapping keyboard focus */
.card__link::before { content: ""; position: absolute; inset: 0; }

/* Waste-type chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  background: var(--white);
  color: var(--ink-70);
}
.section--ink .chip { background: var(--ink-90); border-color: var(--ink-70); color: var(--steel-light); }

/* ==========================================================================
   9. Prose (page content)
   ========================================================================== */

.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }
.prose > *:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2em; margin-bottom: var(--sp-4); }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--amber-deep); }
.prose blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-5);
  border-left: 4px solid var(--amber);
  background: var(--amber-wash);
  font-size: var(--step-1);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* Service page image. Sits between definition and body, full wrap width,
   cropped to a landscape strip so a tall photo never dominates. */
.service-image {
  margin: 0;
  padding-block: var(--sp-4);
  background: var(--paper-warm);
}
.service-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-low);
}

/* Definition block. Written to be lifted verbatim into an AI Overview. */
.definition {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}
.definition__term {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel);
  margin-bottom: var(--sp-2);
}
.definition p { font-size: var(--step-1); margin: 0; }

/* Terminology block. Sits directly under the definition so the disambiguation
   passage stays in the first screen, which is where the page-one competitors
   put theirs. Reuses .tier-table for the grid. */
.terminology {
  margin-bottom: var(--sp-7);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--hairline);
}
.terminology > h2 { margin-bottom: var(--sp-4); }
.terminology .prose { margin-bottom: var(--sp-5); }
.terminology .tier-table { min-width: 0; }
.terminology .tier-table td { font-size: var(--step--1); }
/* Term column stays on one line so the table reads as a lookup, not prose. */
.terminology .tier-table tbody th { white-space: nowrap; vertical-align: top; }

/* Tables inside editor content (.prose) get the same treatment as .tier-table
   so content moved from template to wp-admin keeps its styled appearance. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.prose table caption {
  text-align: left;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.prose table thead th {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
}
.prose table tbody td {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--hairline);
  vertical-align: top;
  text-align: left;
}
.prose table tbody td:first-child { font-weight: 600; white-space: nowrap; }
.prose table tbody tr:nth-child(even) { background: var(--paper); }
.prose table tbody tr:hover { background: var(--amber-wash); }

/* ==========================================================================
   9b. Competence lookup table
   ========================================================================== */

/* The table scrolls inside this, never the page. */
.tier-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  min-width: 920px;
}

/* Visible caption: names the table as a citable resource. */
.tier-table__caption {
  text-align: left;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--hairline);
}
.tier-table__caption-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tier-table__caption-sub {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel);
}

/* Provenance line under the table: source, freshness, CSV download. */
.tier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  margin: var(--sp-4) 0 var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel);
}
.tier-meta > * { position: relative; }
.tier-meta > * + *::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-3) * -1);
  top: 0.15em;
  width: 2px;
  height: 1em;
  background: var(--amber);
}
.tier-meta > * + * { margin-left: var(--sp-3); }
.tier-meta time { color: var(--ink); }
.tier-meta a { font-weight: 600; }

.tier-table thead th {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  position: sticky;
  top: 0;
}

.tier-table tbody th,
.tier-table tbody td {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--hairline);
  vertical-align: top;
  text-align: left;
}

.tier-table tbody th {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  max-width: 34ch;
}

.tier-table tbody tr:nth-child(even) { background: var(--paper); }
.tier-table tbody tr:hover { background: var(--amber-wash); }

/* Tier pill. Colour carries meaning, so each also differs in text. */
.tier {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 100px;
  white-space: nowrap;
  border: 1px solid;
}
.tier--low    { background: #E7F4EF; color: #14513D; border-color: var(--go); }
.tier--medium { background: var(--amber-wash); color: #7A4E00; border-color: var(--amber-deep); }
.tier--high   { background: var(--signal-wash); color: #8C2418; border-color: var(--signal); }

.tier-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 0 var(--sp-2);
  margin-right: var(--sp-2);
}
.tier-title { color: var(--ink-70); }

.tier-caveat {
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-left: 4px solid var(--steel);
  background: var(--paper-warm);
  font-size: var(--step--1);
  color: var(--ink-70);
}

/* Filter bar above the competence table */
.tier-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-4);
}
.tier-filter-search {
  flex: 1 1 260px;
  min-width: 0;
}
.tier-filter-search__input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--step--1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.tier-filter-search__input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-wash);
}
.tier-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  background: var(--white);
  color: var(--steel);
  cursor: pointer;
  transition: all 0.15s;
}
.tier-pill:hover { border-color: var(--amber); color: var(--ink); }
.tier-pill--active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.tier-pill__count {
  background: rgba(255,255,255,0.2);
  padding: 0 var(--sp-2);
  border-radius: 100px;
  font-size: 0.65rem;
}

.tier-sr { font-family: var(--font-mono); font-size: 0.75rem; }
.tier-na { color: var(--steel-light); font-style: italic; }
.tier-no-results {
  text-align: center;
  padding: var(--sp-6);
  color: var(--steel);
  font-size: var(--step--1);
}

/* ==========================================================================
   10. FAQ accordion
   ========================================================================== */

.faq { border-top: 1px solid var(--hairline); }
.faq__item { border-bottom: 1px solid var(--hairline); }
.faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-5) var(--sp-6) var(--sp-5) 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  position: relative;
  display: block;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--amber-deep);
  font-weight: 400;
  transition: transform 0.18s ease;
}
.faq__item[open] summary::after { content: "\2013"; }
.faq__item summary:hover { color: var(--amber-deep); }
.faq__answer { padding-bottom: var(--sp-5); max-width: 68ch; color: var(--ink-70); }

/* ==========================================================================
   11. Steps
   ========================================================================== */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: var(--sp-5); }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-5);
  align-items: start;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--ink);
  background: var(--amber);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  flex: none;
}
.steps h3 { font-size: var(--step-1); margin-bottom: var(--sp-2); }
.steps p { font-size: var(--step--1); color: var(--ink-70); margin: 0; }
.section--ink .steps p { color: var(--steel-light); }

/* ==========================================================================
   12. Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: var(--sp-5); }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
  color: var(--ink);
}
.form-field .req { color: var(--signal); }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--hairline);
  border-radius: var(--radius);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--amber-wash);
}
.form-field textarea { min-height: 150px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--steel); margin-top: var(--sp-2); }

.contact-aside {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: var(--sp-6);
}
.contact-aside h3 { color: var(--white); font-size: var(--step-1); }
.contact-aside a { color: var(--amber); }
.contact-aside dl { margin: 0; }
.contact-aside dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel-light);
  margin-top: var(--sp-5);
}
.contact-aside dd { margin: var(--sp-1) 0 0; font-size: var(--step-0); }

/* Privacy notice sits directly above the submit button, where the reader is
   actually deciding whether to hand over their details. */
.form-privacy {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--steel);
  background: var(--paper-warm);
  border-left: 3px solid var(--steel-light);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.form-privacy a { color: var(--ink); }

.form-notice {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  font-size: var(--step--1);
}
.form-notice--ok { background: #E7F4EF; border: 1px solid var(--go); color: #14513D; }
.form-notice--err { background: var(--signal-wash); border: 1px solid var(--signal); color: #8C2418; }

/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer { background: var(--ink); color: var(--steel-light); padding-block: var(--sp-8) var(--sp-6); }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}
@media (max-width: 980px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

.site-footer__note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--steel-light);
  margin-top: var(--sp-3);
}
.site-footer h4 {
  color: var(--white);
  font-size: var(--step--1);
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-4);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.site-footer a { color: var(--steel-light); text-decoration: none; font-size: var(--step--1); }
.site-footer a:hover { color: var(--amber); }
.site-footer__blurb { font-size: var(--step--1); max-width: 40ch; }
.site-footer__legal {
  border-top: 1px solid var(--ink-70);
  padding-top: var(--sp-5);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

/* ==========================================================================
   14. Page load reveal
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .reveal:nth-child(1) { animation-delay: 0.04s; }
  .reveal:nth-child(2) { animation-delay: 0.12s; }
  .reveal:nth-child(3) { animation-delay: 0.2s; }
  .reveal:nth-child(4) { animation-delay: 0.28s; }
  .hero .reveal { animation-name: rise-lcp; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-lcp {
  from { transform: translateY(14px); }
  to   { transform: none; }
}

/* ==========================================================================
   13b. Breadcrumb (visible twin of the BreadcrumbList schema)
   ========================================================================== */

.breadcrumb { margin-bottom: var(--sp-4); }
.breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel-light);
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.breadcrumb__item + .breadcrumb__item::before {
  content: "\2192";
  color: var(--amber);
}
.breadcrumb a {
  color: var(--steel-light);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--amber);
}
.breadcrumb__current {
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34ch;
}

/* ==========================================================================
   14a. E-E-A-T trust components: review line + sources
   ========================================================================== */

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  margin: var(--sp-5) 0 var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel);
}
.page-meta__item { position: relative; }
.page-meta__item + .page-meta__item { padding-left: var(--sp-4); }
.page-meta__item + .page-meta__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 2px;
  height: 1em;
  background: var(--amber);
}
.page-meta strong { color: var(--ink); font-weight: 600; }
.page-meta time { color: var(--ink); }

.sources {
  list-style: none;
  counter-reset: src;
  margin: var(--sp-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--sp-3);
}
.sources__item {
  counter-increment: src;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-3);
  align-items: baseline;
  padding: var(--sp-4);
  background: var(--white);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
}
.sources__item::before {
  content: counter(src);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--steel);
  font-size: var(--step--1);
}
.sources__link { font-weight: 600; text-decoration-color: var(--amber); }
.sources__pub {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel);
}

/* ==========================================================================
   14a-ii. News listing + single post
   ========================================================================== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-6);
}
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-mid);
  border-color: var(--steel-light);
}
.news-card__media {
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
}
.news-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  flex: 1;
}
.news-card__date {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel);
  margin: 0;
}
.news-card__title { font-size: var(--step-2); margin: 0; }
.news-card__title a { text-decoration: none; }
/* Stretch the title link across the whole card for one clean click target. */
.news-card__title a::after { content: ""; position: absolute; inset: 0; }
.news-card__excerpt { font-size: var(--step--1); color: var(--ink-70); margin: 0; }
.news-card__cta {
  margin-top: auto;
  padding-top: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.news-card__cta::after { content: "\2192"; transition: transform 0.16s ease; }
.news-card:hover .news-card__cta::after { transform: translateX(4px); }

/* Single post */
.hero--post { padding-block: var(--sp-8) var(--sp-6); }
.hero--post .eyebrow a { color: var(--amber); text-decoration: none; }
.post__meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--steel-light);
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin: 0;
}
.post__figure {
  margin: 0 0 var(--sp-7);
}
.post__hero-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.post__back {
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* ==========================================================================
   14b. Sticky CTA (fixed, follows the reader as they scroll)
   ========================================================================== */

.sticky-cta {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 60; /* above the sticky header (50) */
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  padding: var(--sp-4) var(--sp-5);
  background: var(--amber);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease,
              background-color 0.14s ease, opacity 0.25s ease, visibility 0.25s ease;
}
.sticky-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--amber-deep);
}
.sticky-cta:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.sticky-cta__arrow { font-family: var(--font-mono); font-size: var(--step-1); line-height: 1; }

/* JS-driven states: hidden until the reader scrolls, tucked away over the footer. */
.sticky-cta.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  pointer-events: none;
}

/* No point offering a link to the contact page while on the contact page. */
body.page--contact .sticky-cta { display: none; }

@media (max-width: 640px) {
  .sticky-cta {
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: opacity 0.2s ease, visibility 0.2s ease; }
  .sticky-cta:hover, .sticky-cta:active { transform: none; }
  .sticky-cta.is-hidden { transform: none; }
}

/* ==========================================================================
   15. Print
   ========================================================================== */

@media print {
  .site-header, .site-footer, .hero__actions, .nav-toggle, .sticky-cta { display: none; }
  body { background: #fff; color: #000; }
}

/* -------------------------------------------------------------------------
   Work with us: reason chooser + reason-specific field panels.
   ------------------------------------------------------------------------- */

.intent-field { border: 0; padding: 0; margin: 0 0 var(--sp-5); min-width: 0; }
.intent-field > legend {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: var(--sp-3);
  padding: 0;
}
.intent-field .req { color: var(--signal); }

.intent-choice {
  display: grid;
  gap: var(--sp-3);
  /* Three reasons, so lock to three columns (never auto-fit to two, which
     orphans the third). Stacks to one column on narrow screens. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 560px) {
  .intent-choice { grid-template-columns: 1fr; }
}
.intent-option {
  position: relative;
  display: block;
  padding: var(--sp-4);
  padding-left: calc(var(--sp-4) + 1.9rem);
  background: var(--white);
  border: 2px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.intent-option:hover { border-color: var(--steel-light); }
.intent-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--amber-wash);
}
.intent-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--amber-wash); }
.intent-option__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}
.intent-option__note {
  display: block;
  font-size: var(--step--1);
  color: var(--steel);
  margin-top: var(--sp-1);
}

/* Reason-specific panels. Hidden only when JS is active (.is-enhanced); with
   no JS every panel shows and stays fully usable. */
.intent-panel {
  border-left: 3px solid var(--amber);
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.intent-panel__lead { font-size: var(--step--1); color: var(--steel); margin-bottom: var(--sp-4); }
[data-branch-form].is-enhanced .intent-panel { display: none; }
[data-branch-form].is-enhanced .intent-panel.is-active { display: block; }

/* Fieldset that reuses .form-field spacing (risk-tier checkboxes). */
fieldset.form-field { border: 0; padding: 0; min-width: 0; }
fieldset.form-field > legend {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: var(--sp-2);
  padding: 0;
}
.check-group { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.check span { font-size: var(--step-0); color: var(--ink); }

/* Reset the full-width text-input styling for the choice controls. */
.intent-option input,
.check input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--amber-deep);
}
.intent-option input { position: absolute; top: var(--sp-4); left: var(--sp-4); }

/* -------------------------------------------------------------------------
   On-this-page index + "what's included" disclosure (training guide).
   ------------------------------------------------------------------------- */

.page-index {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: var(--sp-5);
  background: var(--white);
}
.page-index__title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel);
  margin: 0 0 var(--sp-3);
}
.page-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: idx;
}
.page-index__list li {
  break-inside: avoid;
  margin-bottom: var(--sp-3);
  counter-increment: idx;
}
.page-index__list a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--ink);
  text-decoration: none;
}
.page-index__list a::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--amber-deep);
  margin-right: 0.6em;
}
.page-index__list a:hover { color: var(--amber-deep); text-decoration: underline; }

.page-index--rail {
  width: min(100% - 2.5rem, var(--wrap-tight));
  margin-inline: auto;
  margin-block: var(--sp-5);
}
.page-index--rail .page-index__list { columns: 2; column-gap: var(--sp-7); }
@media (max-width: 40rem) { .page-index--rail .page-index__list { columns: 1; } }

@media (min-width: 80rem) {
  .page-index--rail {
    position: fixed;
    top: 5.5rem;
    left: 0.75rem;
    width: 11rem;
    margin: 0;
    z-index: 10;
    border: none;
    border-left: 3px solid var(--amber);
    border-radius: 0;
    background: color-mix(in srgb, var(--paper) 85%, transparent);
    padding: var(--sp-3) var(--sp-4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
  }
  .page-index--rail.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .page-index--rail .page-index__title { font-size: 0.7rem; margin-bottom: var(--sp-2); }
  .page-index--rail .page-index__list { columns: 1; }
  .page-index--rail .page-index__list li { margin-bottom: var(--sp-2); }
  .page-index--rail .page-index__list a { font-size: var(--step--2); }

  .page-index--rail ~ .section > .wrap,
  .page-index--rail ~ .section > .wrap--tight,
  .page-index--rail ~ .service-image > .wrap {
    margin-left: max(14rem, calc((100vw - var(--wrap)) / 2));
  }
}

.includes {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  margin-top: var(--sp-5);
  max-width: 72ch;
}
.includes__summary {
  cursor: pointer;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.includes__summary::-webkit-details-marker { display: none; }
.includes__summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: var(--step-1);
  line-height: 1;
  color: var(--amber-deep);
  flex: none;
}
.includes[open] .includes__summary::after { content: "\2212"; }
.includes__summary:hover { color: var(--amber-deep); }
.includes__body {
  padding: 0 var(--sp-5) var(--sp-5);
}
.includes__list {
  margin: var(--sp-3) 0 var(--sp-4);
  padding-left: 1.2em;
}
.includes__list li { margin-bottom: var(--sp-2); }
.includes__note {
  font-size: var(--step--1);
  color: var(--steel);
  margin: 0;
}

/* -------------------------------------------------------------------------
   Header phone CTA. The amber primary reads low-contrast in the dark header
   (white-on-amber, forced white by `.nav a`), so give the header button a
   navy fill with white text and an amber border/shadow: high contrast and
   still distinct against the navy bar. Header-scoped, so other primary
   buttons are unaffected.
   ------------------------------------------------------------------------- */
.site-header__bar .btn--primary {
  background: var(--ink-90);
  color: var(--white);
  border-color: var(--amber);
  box-shadow: 4px 4px 0 var(--amber);
}
.site-header__bar .btn--primary:hover {
  background: var(--ink-70);
  color: var(--white);
  box-shadow: 6px 6px 0 var(--amber);
}
.site-header__bar .btn--primary:active {
  box-shadow: 1px 1px 0 var(--amber);
}
