/* ramsgatesecurity.co.uk - "Harbour Light" design system. See DESIGN.md.
   Deep harbour teal + bone + lighthouse amber. Barlow Semi Condensed + Public Sans. */
:root {
  --harbour: #0c2629;
  --harbour-2: #123a3e;
  --harbour-3: #1a4a4f;
  --bone: #f2eee3;
  --paper: #fbf9f3;
  --ink: #0f1d20;
  --ink-soft: #425659;
  --mist: #c3d7d6;
  --rule: #d9d3c3;
  --rule-dark: #b9b19c;
  --teal: #0a6663;
  --teal-deep: #084e4c;
  --beam: #f2b04c;
  --beam-deep: #8a5a0a;
  --wa: #0a6e3d;
  --wa-deep: #085832;
  --font-display: 'Barlow Semi Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-text: 'Public Sans', -apple-system, 'Segoe UI', Arial, sans-serif;
  --max: 1160px;
  --content: 720px;
  /* legacy aliases used by inline styles in generated pages */
  --graphite: var(--harbour);
  --graphite-deep: var(--harbour);
  --stone: var(--mist);
  --steel: #9bb4b3;
  --blue: var(--teal);
  --blue-deep: var(--teal-deep);
  --cyan: var(--beam);
  --cyan-bright: var(--beam);
  --amber: var(--beam);
  --mist-bg: var(--bone);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-text); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--bone); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.08; color: var(--harbour); }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); margin: 0 0 0.45em; font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.65rem); margin: 1.7em 0 0.55em; }
h3 { font-size: 1.45rem; margin: 1.4em 0 0.35em; font-weight: 700; }
p { margin: 0 0 1.1em; }

a { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); }
:focus-visible { outline: 3px solid var(--beam); outline-offset: 2px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--content); margin: 0 auto; padding: 0 1.5rem; }

/* Topbar */
.topbar { background: var(--harbour); color: var(--mist); font-size: 0.875rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.topbar a { color: var(--mist); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar span em { color: var(--beam); font-style: normal; font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.badge { display: inline-block; background: var(--beam); color: var(--harbour); padding: 0.12rem 0.55rem; border-radius: 2px; font-size: 0.8rem; font-weight: 700; margin-right: 0.6rem; }

/* Header */
header.site { background: var(--paper); border-bottom: 3px solid var(--harbour); padding: 0.9rem 0; position: relative; z-index: 50; }
@media (min-width: 960px) { header.site { position: sticky; top: 0; } }
header.site .container { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--harbour); text-decoration: none; line-height: 1; display: flex; align-items: center; gap: 0.65rem; letter-spacing: 0.01em; text-transform: uppercase; }
.brand:hover { color: var(--harbour); }
.brand .mark { display: inline-flex; width: 36px; height: 36px; flex-shrink: 0; }
.brand small { display: block; font-family: var(--font-text); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 0.3rem; }
nav.primary ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
nav.primary a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; position: relative; padding: 0.35rem 0; letter-spacing: 0.01em; }
nav.primary a:hover { color: var(--teal); }
nav.primary a.active { color: var(--harbour); }
nav.primary a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -0.2rem; height: 3px; background: var(--beam); }

/* Hero (home): photo field with a diagonal text panel, beam-edge */
.hero { background: var(--harbour); color: #fff; position: relative; overflow: hidden; padding: 0; }
.hero-media { margin: 0; position: relative; aspect-ratio: 3 / 2; max-height: 340px; width: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero .container { position: relative; z-index: 2; padding-top: 2.2rem; padding-bottom: 2.6rem; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero .lede { font-size: 1.1rem; max-width: 40rem; color: var(--mist); margin-bottom: 1.8rem; }
.hero .section-eyebrow { color: var(--beam); }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
@media (min-width: 960px) {
  .hero:has(.hero-copy) { min-height: 640px; display: flex; align-items: stretch; }
  .hero-media { position: absolute; inset: 0 0 0 42%; width: auto; max-height: none; aspect-ratio: auto; }
  .hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,38,41,0.55) 0%, rgba(12,38,41,0) 30%); }
  .hero .container:has(.hero-copy) { padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }
  .hero-copy { position: relative; width: min(66%, 760px); padding: 4.5rem 4rem 4.5rem 0; background: var(--harbour); }
  .hero-copy::before { content: ''; position: absolute; top: 0; bottom: 0; right: 0; left: -100vw; background: var(--harbour); z-index: -1; }
  .hero-copy::after { content: ''; position: absolute; top: 0; bottom: 0; right: -140px; width: 220px; background: var(--harbour); clip-path: polygon(0 0, 35% 0, 100% 100%, 0 100%); z-index: -1; }
  .hero h1 { max-width: none; font-size: clamp(2.6rem, 4.6vw, 3.9rem); }
  .hero .lede { max-width: 34rem; }
}

/* Inner hero: bone band with ruled harbour tick */
.hero.hero-light { background: var(--bone); color: var(--ink); padding: 3.2rem 0 2.6rem; border-bottom: 1px solid var(--rule-dark); min-height: 0; display: block; overflow: visible; }
.hero.hero-light .container { padding-top: 0; padding-bottom: 0; display: block; }
.hero.hero-light h1 { color: var(--harbour); max-width: 22ch; }
.hero.hero-light .lede { color: var(--ink-soft); font-size: 1.15rem; max-width: 46rem; margin-bottom: 0; }
.hero.hero-light .section-eyebrow { color: var(--teal-deep); }

/* Proof strip */
.proof { background: var(--harbour-2); color: #fff; padding: 0; border-top: 3px solid var(--beam); }
.proof ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.proof li { padding: 1.1rem 1.2rem; border-right: 1px solid rgba(255,255,255,0.12); border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 0.92rem; line-height: 1.35; color: var(--mist); }
.proof li strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--beam); font-weight: 700; margin-bottom: 0.15rem; }
@media (min-width: 960px) { .proof ul { grid-template-columns: repeat(4, 1fr); max-width: var(--max); margin: 0 auto; } .proof li { border-bottom: 0; padding: 1.4rem 1.5rem; } .proof li:first-child { border-left: 1px solid rgba(255,255,255,0.12); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0.8rem 1.6rem; font-family: var(--font-text); font-weight: 700; font-size: 1rem; text-decoration: none; border-radius: 2px; transition: background 0.15s ease, color 0.15s ease; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--beam); color: var(--harbour); border-color: var(--beam); }
.btn-primary:hover { background: #fff; border-color: #fff; color: var(--harbour); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-ghost:hover { background: #fff; color: var(--harbour); }
section:not(.hero) .btn-primary, .hero-light .btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
section:not(.hero) .btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.hero-light .btn-ghost, section:not(.hero) .btn-ghost { color: var(--harbour); border-color: var(--harbour); }
.hero-light .btn-ghost:hover, section:not(.hero) .btn-ghost:hover { background: var(--harbour); color: #fff; }
button.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; font-family: var(--font-text); }
button.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }

/* Sections */
section { padding: 4.5rem 0; background: var(--bone); }
section.tight { padding: 2rem 0; }
section.alt { background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-eyebrow { display: flex; align-items: center; gap: 0.7rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--teal-deep); margin: 0 0 0.6em; }
.section-eyebrow::before { content: ''; width: 28px; height: 3px; background: var(--beam); flex-shrink: 0; }
.hero.hero-light .section-eyebrow::before { background: var(--harbour); }
.container.center .section-eyebrow, .center .section-eyebrow { justify-content: center; }

/* Grids */
.grid { display: grid; gap: 1.5rem; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 3rem; } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Services as a ruled harbour-chart index (not boxed cards) */
.grid-4 { counter-reset: svc; gap: 0 3rem; border-top: 3px solid var(--harbour); }
.grid-4 .card { counter-increment: svc; background: transparent; border: 0; border-bottom: 1px solid var(--rule-dark); border-radius: 0; box-shadow: none; padding: 1.5rem 0 1.4rem 4.2rem; position: relative; transition: background 0.15s ease; }
.grid-4 .card::before { content: counter(svc, decimal-leading-zero); position: absolute; left: 0; top: 1.45rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink-soft); letter-spacing: 0.04em; }
.grid-4 .card .card-icon { position: absolute; left: 2.1rem; top: 1.35rem; width: 28px; height: 28px; color: var(--teal); }
.grid-4 .card h3 { margin: 0 0 0.3em; font-size: 1.4rem; }
.grid-4 .card:hover { background: var(--paper); }
@media (min-width: 700px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--paper); border: 1px solid var(--rule-dark); padding: 1.6rem; border-radius: 2px; }
.card h3 { margin-top: 0; }
.card p { margin: 0 0 0.5em; color: var(--ink-soft); font-size: 0.98rem; }
.card a.card-link { color: var(--harbour); text-decoration: none; }
.card a.card-link::after { content: ''; position: absolute; inset: 0; }
.card a.card-link:hover { color: var(--teal); }
.card .more { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem; font-size: 0.9rem; font-weight: 700; color: var(--teal); text-decoration: none; position: relative; z-index: 1; }
.card .more::after { content: ' \2192'; }
.card { position: relative; }

/* Promises: dark band */
.guarantees { background: var(--harbour); border: 0; color: #fff; }
.guarantees h2 { color: #fff; }
.guarantees .section-eyebrow { color: var(--beam); }
.guarantees .grid { gap: 1px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.14); margin-top: 2.2rem !important; }
.guarantees .promise { background: var(--harbour-2); padding: 2rem 1.8rem; }
.guarantees .promise .icon { display: block; width: 40px; height: 40px; color: var(--beam); margin-bottom: 1rem; }
.guarantees .promise .icon svg { width: 100%; height: 100%; }
.guarantees .promise h3 { color: #fff; margin: 0 0 0.4em; font-size: 1.5rem; }
.guarantees .promise p { margin: 0; color: var(--mist); font-size: 0.98rem; line-height: 1.6; }
.guarantee-pill { display: inline-block; background: var(--harbour); color: var(--beam); padding: 0.3rem 0.8rem; border-radius: 2px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; margin: 0.5rem 0.5rem 0 0; }

/* Photos */
.photo { margin: 0; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.band { padding: 0; background: var(--harbour); }
.photo-band { padding: 0; background: var(--harbour); }
.photo-band figure { margin: 0; max-width: none; }
.photo-band img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; }
@media (max-width: 700px) { .photo-band img { aspect-ratio: 16 / 9; } }
.stack { display: grid; gap: 1.2rem; }
.stack .photo { aspect-ratio: 3 / 2; border: 4px solid var(--paper); box-shadow: 0 0 0 1px var(--rule-dark); }

/* Panel */
.panel { background: var(--harbour); color: #fff; padding: 2.4rem; border-radius: 2px; border-top: 4px solid var(--beam); }
.panel h2 { color: #fff; margin-top: 0; }
.panel .section-eyebrow { color: var(--beam); }
.panel p { color: var(--mist); }
.panel a { color: var(--beam); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; font-weight: 700; }
.panel a:hover { color: #fff; }

/* Pricing table */
table.pricing { width: 100%; border-collapse: collapse; margin: 1.4rem 0 1.8rem; font-size: 0.97rem; background: var(--paper); border-top: 3px solid var(--harbour); }
table.pricing th, table.pricing td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--rule); }
table.pricing thead th { background: var(--harbour); color: #fff; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
table.pricing tbody tr:hover { background: var(--bone); }
table.pricing td:last-child, table.pricing th:last-child { text-align: right; white-space: nowrap; }
table.pricing td strong { color: var(--harbour); font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
table.pricing caption { text-align: left; caption-side: top; font-weight: 700; color: var(--harbour); margin-bottom: 0.4rem; font-family: var(--font-display); font-size: 1.15rem; }
@media (max-width: 520px) { table.pricing th, table.pricing td { padding: 0.65rem 0.6rem; } table.pricing td:last-child { white-space: normal; } }

/* Footer */
footer.site { background: var(--harbour); color: var(--mist); padding: 3.5rem 0 2rem; margin-top: 0; border-top: 4px solid var(--beam); }
footer.site h4 { color: #fff; font-size: 1rem; margin: 0 0 0.9em; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin: 0.45rem 0; }
footer.site a { color: var(--mist); text-decoration: none; font-size: 0.95rem; }
footer.site a:hover { color: var(--beam); }
.foot-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.foot-bottom { border-top: 1px solid rgba(255,255,255,0.14); margin-top: 2.5rem; padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: #9fbab9; }
.foot-bottom a { color: #9fbab9; }
.foot-bottom a:hover { color: var(--beam); }

/* Article */
article.guide { padding: 3rem 0; }
article.guide .meta { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
article.guide .meta a { color: var(--teal); }
article.guide blockquote { border-left: 4px solid var(--beam); margin: 1.8em 0; padding: 0.4em 0 0.4em 1.4rem; color: var(--harbour); font-family: var(--font-display); font-size: 1.45rem; line-height: 1.3; font-weight: 600; }
article.guide ul, article.guide ol, .prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
article.guide li, .prose li { margin: 0.4em 0; }
article.guide li::marker, .prose li::marker { color: var(--teal); }
.callout { background: var(--paper); border: 1px solid var(--rule-dark); border-left: 5px solid var(--teal); padding: 1.2rem 1.5rem; margin: 1.8em 0; border-radius: 0 2px 2px 0; }
.callout h4 { margin: 0 0 0.4em; color: var(--harbour); font-size: 1.2rem; }
.callout.note { border-left-color: var(--beam); }
.callout > :last-child { margin-bottom: 0; }

/* Breadcrumb */
.crumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1rem; }
.crumb a { color: var(--teal-deep); text-decoration: none; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }

/* Contact form */
.form-grid { display: grid; gap: 1.2rem; max-width: 580px; background: var(--paper); border: 1px solid var(--rule-dark); border-top: 4px solid var(--harbour); padding: 1.6rem; }
.form-row { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-field { margin-bottom: 0; }
label, legend { font-weight: 700; font-size: 0.88rem; display: block; margin-bottom: 0.4rem; color: var(--harbour); letter-spacing: 0.01em; }
input, textarea, select { width: 100%; padding: 0.8rem 0.9rem; min-height: 48px; border: 1px solid var(--rule-dark); background: #fff; font-family: inherit; font-size: 1rem; color: var(--ink); border-radius: 2px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--beam); outline-offset: 0; border-color: var(--harbour); }
textarea { min-height: 140px; resize: vertical; }
.form-radio-group { display: flex; gap: 1.5rem; }
.form-radio { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 500; }
.form-radio input { width: auto; min-height: 0; padding: 0; accent-color: var(--teal); }
.form-alert { padding: 0.9rem 1.1rem; border-radius: 2px; font-size: 0.95rem; margin-bottom: 1rem; }
.form-alert--error { background: #fdeeee; border: 1px solid #e3b4b4; color: #7a1c1c; }
.form-alert--ok { background: #e6f3ef; border: 1px solid #a9d3c8; color: #0f5547; }

/* Utility */
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.divider-rule { height: 3px; background: var(--beam); margin: 3rem 0; max-width: 56px; }
.divider-rule.center { margin-left: auto; margin-right: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-svg { width: 100%; height: 100%; }

@media (max-width: 700px) {
  body { font-size: 16.5px; }
  header.site .container { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  nav.primary ul { gap: 0.3rem 1.1rem; font-size: 0.9rem; }
  section { padding: 3rem 0; }
  .panel { padding: 1.8rem 1.4rem; }
  .grid-4 .card { padding-left: 3.6rem; }
  .grid-4 .card .card-icon { left: 1.8rem; }
  .hero h1 { max-width: none; }
  .form-grid { padding: 1.2rem; }
}

/* WhatsApp button (deep green so white text clears 4.5:1) */
.wa-btn { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--wa); color: #fff !important; padding: 0.35rem 0.85rem; min-height: 32px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; text-decoration: none !important; }
.wa-btn:hover { background: var(--wa-deep); color: #fff !important; }
.wa-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.wa-btn-lg { background: var(--wa); border-color: var(--wa); color: #fff; padding: 0.8rem 1.5rem; border-radius: 2px; border-width: 2px; border-style: solid; }
.btn.wa-btn-lg:hover { background: var(--wa-deep); border-color: var(--wa-deep); color: #fff; }
.btn.wa-btn-lg svg { width: 20px; height: 20px; }
.topbar .wa-btn { padding: 0.2rem 0.7rem; font-size: 0.8rem; }
.topbar .wa-btn svg { width: 14px; height: 14px; }
@media (max-width: 700px) { .topbar .wa-btn { display: none; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
.photo-band img[src*="marina"] { object-position: center 10%; }
.photo-band img[src*="install"] { object-position: center 42%; }
@media (max-width: 520px) { table.pricing { font-size: 0.88rem; } table.pricing th, table.pricing td { padding: 0.6rem 0.45rem; overflow-wrap: anywhere; } table.pricing thead th { letter-spacing: 0.04em; } table.pricing td:last-child, table.pricing th:last-child { white-space: normal; } }

.prose > h2:first-child, article.guide .prose > h2:first-child { margin-top: 0; }

.hero:not(:has(.hero-copy)):not(.hero-light) .container { padding-top: 4rem; padding-bottom: 4rem; }
.hero:not(:has(.hero-copy)) h1 { max-width: none; }
