/* =========================================================================
   Verulam Locksmiths — shared stylesheet
   Palette & type per research/design-language.md
   Light theme is default on :root; dark override gated on [data-theme="dark"]
   ========================================================================= */

/* ---- Design tokens: LIGHT (default) ---------------------------------- */
:root {
  /* Brand grounds & surfaces */
  --graphite: #26303A;        /* header, footer, primary buttons, headings */
  --anthracite: #1A222A;      /* deep ground / hero overlay */
  --ground: #F5F4F1;          /* warm bone page ground */
  --surface: #FFFFFF;         /* card / panel fill (flips in dark) */
  --fog: #E4E6E8;             /* quiet bands, hairline borders */

  /* Text */
  --ink: #1C2126;             /* body text on light (~14:1 on bone) */
  --muted: #586471;           /* secondary text, captions, meta */

  /* Accents */
  --brass: #B0842B;           /* fills / icons / rules / large display only */
  --brass-text: #7A5A16;      /* AA-safe deep brass for small brass text */
  --signal: #C22E28;          /* emergency call button ONLY */
  --signal-hover: #A82722;

  /* On-brand text — sits on graphite/hero/footer/buttons.
     NEVER remapped to a dark colour in dark theme. */
  --on-brand: #F5F4F1;

  /* Derived */
  --border: #D9DBDE;
  --shadow: 0 1px 2px rgba(28, 33, 38, .06), 0 6px 20px rgba(28, 33, 38, .08);
  --shadow-lg: 0 10px 40px rgba(28, 33, 38, .14);
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1120px;

  --font-head: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

/* ---- Design tokens: DARK -------------------------------------------- */
[data-theme="dark"] {
  --graphite: #26303A;        /* keep the brand graphite for header/footer */
  --ground: #131A21;          /* deep ground — deepened so cards separate */
  --surface: #2E3B47;         /* card fill — ~1.5:1 vs ground, its own token */
  --fog: #2C3742;

  --ink: #E8EAEC;
  --muted: #9AA5B0;

  --brass: #D0A24A;           /* lifted brass for contrast on dark ground */
  --brass-text: #D0A24A;      /* dark mode uses lifted brass for small text too */
  --signal: #C22E28;          /* unchanged — passes AA with white */
  --signal-hover: #D8352E;

  /* on-brand stays near-white — DO NOT change */
  --on-brand: #F5F4F1;

  --border: #43515D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .38);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .5);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  color: var(--graphite);
  margin: 0 0 .5em;
  letter-spacing: .2px;
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 { color: var(--ink); }

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }
a { color: var(--brass-text); }
a:hover { color: var(--graphite); }
[data-theme="dark"] a:hover { color: var(--brass); }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--brass-text);
  margin: 0 0 .5rem;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

/* ---- [TO CONFIRM] chip ---------------------------------------------- */
.confirm-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--brass-text);
  background: rgba(176, 132, 43, .13);
  border: 1px solid rgba(176, 132, 43, .4);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
[data-theme="dark"] .confirm-chip {
  color: var(--brass);
  background: rgba(208, 162, 74, .12);
  border-color: rgba(208, 162, 74, .4);
}

/* =========================================================================
   Buttons — every CTA has a class so scoped dark link rules can't touch it
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: .8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--graphite); color: var(--on-brand); }
.btn-primary:hover { background: var(--anthracite); color: var(--on-brand); }
[data-theme="dark"] .btn-primary { background: var(--brass); color: #1A222A; }
[data-theme="dark"] .btn-primary:hover { background: #E0B25A; color: #1A222A; }

.btn-outline { background: transparent; color: var(--graphite); border-color: var(--graphite); }
.btn-outline:hover { background: var(--graphite); color: var(--on-brand); }
[data-theme="dark"] .btn-outline { color: var(--ink); border-color: var(--border); }
[data-theme="dark"] .btn-outline:hover { background: var(--surface); color: var(--ink); }

/* Emergency / call button — signal red, white text, BOTH themes */
.btn-call, .call-btn {
  background: var(--signal);
  color: #fff;
  border-color: transparent;
}
.btn-call:hover, .call-btn:hover { background: var(--signal-hover); color: #fff; }

.btn-lg { font-size: 1.15rem; padding: 1rem 1.8rem; }
.btn-block { display: flex; width: 100%; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--graphite);
  color: var(--on-brand);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px;
  padding: .5rem 20px;
  max-width: var(--maxw); margin: 0 auto;
}

/* Wordmark logo */
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; flex: 0 0 auto; }
.logo svg { height: 26px; width: auto; display: block; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--on-brand);
  line-height: 1;
  white-space: nowrap;
}

.header-spacer { flex: 1 1 auto; }

/* Primary nav */
.main-nav { display: flex; align-items: center; }
.main-nav ul { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .97rem;
  color: var(--on-brand);
  text-decoration: none;
  padding: .5rem .7rem;
  border-radius: 6px;
  white-space: nowrap;              /* guard #2 — no mid-phrase wrap */
}
.main-nav a:hover { background: rgba(255,255,255,.1); color: var(--on-brand); }
.main-nav a[aria-current="page"] { color: var(--brass); box-shadow: inset 0 -2px 0 var(--brass); }
[data-theme="dark"] .main-nav a[aria-current="page"] { color: var(--brass); }

/* Header call button */
.header-call {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--signal); color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  padding: .55rem .95rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex: 0 0 auto;
}
.header-call:hover { background: var(--signal-hover); color: #fff; }
.header-call svg { width: 18px; height: 18px; flex: 0 0 auto; }
.header-call .label { display: inline; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: var(--on-brand);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .15s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,.12); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: var(--on-brand);
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* Off-canvas breakpoint — set high because header row is wide (guard #2).
   Nav labels are short ("Car Keys", "Locks", "Safes & Keys", "Areas") so the
   inline row fits comfortably above this width. */
@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav {
    position: fixed; inset: 64px 0 auto 0;
    background: var(--graphite);
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: var(--shadow-lg);
    display: none;
    padding: .5rem 20px 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: .1rem; }
  .main-nav a { padding: .8rem .6rem; font-size: 1.05rem; }
  .main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brass); }
}
@media (max-width: 480px) {
  .header-call .label { display: none; }   /* icon + number stays; drop word */
  .logo-text { font-size: 1rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  background: linear-gradient(160deg, var(--graphite), var(--anthracite));
  color: var(--on-brand);
  padding: clamp(2.5rem, 7vw, 4.5rem) 0;
  position: relative;
  border-bottom: 3px solid var(--brass);
}
.hero h1 { color: var(--on-brand); max-width: 22ch; }
.hero .lead { color: var(--on-brand); opacity: .92; font-size: 1.2rem; max-width: 52ch; margin-bottom: 1.6rem; }
.hero .hero-sub { color: var(--on-brand); opacity: .8; font-size: 1rem; margin-top: 1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero .btn-call { font-family: var(--font-body); font-weight: 700; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Sections & layout
   ========================================================================= */
.section { padding: clamp(2.2rem, 5vw, 3.6rem) 0; }
.section-tint { background: var(--fog); }
[data-theme="dark"] .section-tint { background: #0F161C; }   /* subtle band below the ground so cards still separate upward */
.section-graphite { background: var(--graphite); color: var(--on-brand); }
.section-graphite h2, .section-graphite h3 { color: var(--on-brand); }
.section-graphite p { color: var(--on-brand); opacity: .9; }
.section-head { max-width: 62ch; margin-bottom: 1.8rem; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* Grid helpers */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* =========================================================================
   Cards — guard #3: dark surface ≥1.35:1 vs ground + border + shadow
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { color: var(--graphite); margin-bottom: .4rem; }
[data-theme="dark"] .card h3 { color: var(--ink); }
.card p { color: var(--muted); margin-bottom: .8rem; }
.card p:last-child { margin-bottom: 0; }
.card .card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: .9rem;
  color: var(--brass);
}
.card .card-icon svg { width: 46px; height: 46px; display: block; }
.card-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem;
  color: var(--brass-text); text-decoration: none;
}
.card-link:hover { color: var(--graphite); }
[data-theme="dark"] .card-link { color: var(--brass); }
[data-theme="dark"] .card-link:hover { color: var(--brass); text-decoration: underline; }

a.card { text-decoration: none; color: inherit; transition: transform .1s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Feature list with brass ticks */
.tick-list { list-style: none; padding: 0; margin: 0; }
.tick-list li { position: relative; padding-left: 1.7rem; margin-bottom: .6rem; }
.tick-list li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: .7rem; height: .38rem;
  border-left: 2.5px solid var(--brass); border-bottom: 2.5px solid var(--brass);
  transform: rotate(-45deg);
}

/* Steps (How a call-out works) */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3.4rem; }
.step .step-num {
  position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--brass); color: #1A222A;
  font-family: var(--font-head); font-weight: 600; font-size: 1.2rem;
  border-radius: 50%;
}
.step h3 { margin-bottom: .25rem; }

/* Trust strip */
.trust-strip { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .trust-strip { grid-template-columns: 1fr; } }
.trust-item {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.trust-item .t-icon { color: var(--brass); flex: 0 0 auto; width: 26px; height: 26px; }
.trust-item .t-icon svg { width: 100%; height: 100%; }
.trust-item strong { display: block; color: var(--ink); font-weight: 700; }
.trust-item span { color: var(--muted); font-size: .93rem; }

/* Areas pill list */
.pill-list { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.pill-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .45rem 1rem;
  font-weight: 600; color: var(--ink); font-size: .96rem;
}

/* Map */
.map-embed {
  width: 100%; aspect-ratio: 16 / 9; min-height: 300px;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--fog);
}

/* NAP / info block */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .9rem; }
.info-list .i-icon { color: var(--brass); flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; }
.info-list .i-icon svg { width: 100%; height: 100%; }
.info-list a { color: var(--brass-text); text-decoration: none; font-weight: 600; }
.info-list a:hover { color: var(--graphite); }
[data-theme="dark"] .info-list a { color: var(--brass); }
.phone-big {
  font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--brass-text); text-decoration: none;
}
[data-theme="dark"] .phone-big { color: var(--brass); }

/* Notice / honest-copy callout */
.notice {
  background: rgba(176, 132, 43, .09);
  border-left: 4px solid var(--brass);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  color: var(--ink);
}
[data-theme="dark"] .notice { background: rgba(208, 162, 74, .08); color: var(--ink); }

/* Placeholder image blocks (no real/stock photos supplied) */
.img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; text-align: center;
  background: repeating-linear-gradient(45deg, var(--fog), var(--fog) 12px, transparent 12px, transparent 24px), var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 2rem 1.5rem;
  min-height: 200px;
}
.img-placeholder .ph-icon { width: 40px; height: 40px; color: var(--brass); }
.img-placeholder .ph-icon svg { width: 100%; height: 100%; }
.img-placeholder .ph-label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; color: var(--brass-text); }
[data-theme="dark"] .img-placeholder .ph-label { color: var(--brass); }
.img-placeholder .ph-note { font-size: .85rem; max-width: 34ch; }

/* =========================================================================
   Forms
   ========================================================================= */
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.field label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.field .req { color: var(--brass-text); }
[data-theme="dark"] .field .req { color: var(--brass); }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .7rem .8rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(176,132,43,.25);
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23586471' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 20px; padding-right: 2.4rem; }
[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA5B0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.form-note { font-size: .9rem; color: var(--muted); margin-top: .3rem; }

/* =========================================================================
   Footer — guard #1: footer links explicitly --on-brand
   ========================================================================= */
.site-footer {
  background: var(--anthracite);
  color: var(--on-brand);
  padding: 2.6rem 0 1.4rem;
  border-top: 3px solid var(--brass);
}
.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--on-brand); font-size: 1.05rem; margin-bottom: .8rem; }
.site-footer p, .site-footer li { color: var(--on-brand); opacity: .85; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: var(--on-brand); text-decoration: none; opacity: .85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; color: var(--on-brand); }
[data-theme="dark"] .site-footer a { color: var(--on-brand); }   /* explicit guard #1 */
.footer-phone { font-variant-numeric: tabular-nums; font-weight: 700; opacity: 1 !important; }
.footer-brand .logo-text { color: var(--on-brand); }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: space-between;
  font-size: .85rem; opacity: .75;
}
.footer-popia { max-width: 60ch; }

/* =========================================================================
   Utilities
   ========================================================================= */
.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.lead { font-size: 1.15rem; color: var(--muted); }
.split { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--border); }
.hours-table th { font-family: var(--font-body); font-weight: 700; color: var(--ink); }
.hours-table td { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Skip link */
.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--signal); color: #fff; padding: .6rem 1rem;
  border-radius: 6px; z-index: 100; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: #fff; }
