/* BBS — bbstech.co.uk
   One stylesheet, no framework, no build step. Tokens first, then layout,
   then components. Light page with dark hero, bands and footer. */

/* --- Tokens ------------------------------------------------------------ */
:root {
  --ink:        #0b1220;   /* near-black navy, body text and dark bands */
  --ink-soft:   #1c2740;
  --slate:      #475569;
  --slate-soft: #64748b;
  --line:       #e2e8f0;
  --paper:      #ffffff;
  --paper-alt:  #f6f8fc;

  --brand:      #2563eb;
  --brand-dark: #1d4ed8;
  --brand-lite: #0ea5e9;
  --brand-wash: #eff5ff;

  --danger:     #b91c1c;
  --danger-bg:  #fef2f2;

  --wrap:  1160px;
  --r-sm:  8px;
  --r:     14px;
  --r-lg:  22px;

  --shadow:    0 1px 2px rgba(11, 18, 32, .06), 0 8px 24px rgba(11, 18, 32, .06);
  --shadow-lg: 0 24px 60px rgba(11, 18, 32, .14);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset -------------------------------------------------------------- */
*, *::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: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--brand-lite);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.nowrap { white-space: nowrap; }

/* --- Layout ------------------------------------------------------------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 720px; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--paper-alt); border-block: 1px solid var(--line); }

.section-head { max-width: 700px; margin-bottom: 3rem; }
.section-head-row {
  max-width: none; display: flex; flex-wrap: wrap; gap: 1.25rem;
  align-items: end; justify-content: space-between;
}
.section-lead { color: var(--slate); font-size: 1.075rem; margin: 0; }

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
}
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--slate); max-width: 62ch; }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(11,18,32,.05); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 74px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand-mark { display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; }
.brand-text small { font-size: .72rem; color: var(--slate-soft); letter-spacing: .01em; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.site-nav a {
  padding: .5rem .8rem; border-radius: var(--r-sm);
  color: var(--ink-soft); font-size: .95rem; font-weight: 550; text-decoration: none;
}
.site-nav a:hover { background: var(--paper-alt); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-wash); }
.nav-cta { margin-left: .6rem; }
.site-nav a.nav-cta[aria-current="page"] { color: #fff; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; color: var(--ink);
}
.bars { display: grid; gap: 4px; justify-items: center; }
.bars i { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.3rem; border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-size: .95rem; font-weight: 650; text-decoration: none;
  cursor: pointer; transition: transform .12s ease, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { padding: .5rem 1rem; font-size: .9rem; }
.btn-lg { padding: .92rem 1.7rem; font-size: 1.02rem; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.32); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-invert { background: #fff; color: var(--ink); }
.btn-invert:hover { background: #eef2f9; }
.centred-page .btn-ghost { color: var(--ink); border-color: var(--line); }
.centred-page .btn-ghost:hover { background: var(--paper-alt); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 650; font-size: .95rem; color: var(--brand-dark); text-decoration: none;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform .15s ease; }
.link-arrow:hover svg, .work-card:hover .link-arrow svg { transform: translateX(4px); }
.back-link { display: inline-block; margin-bottom: 1rem; color: rgba(255,255,255,.75);
  text-decoration: none; font-size: .92rem; font-weight: 550; }
.back-link:hover { color: #fff; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0b1220 0%, #12203c 55%, #0d1a30 100%);
  color: #fff;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
}
.hero-glow {
  position: absolute; inset: -40% -10% auto -10%; height: 120%;
  background:
    radial-gradient(46% 46% at 78% 18%, rgba(14,165,233,.35), transparent 68%),
    radial-gradient(42% 42% at 12% 8%, rgba(37,99,235,.32), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }
/* The heading and lead carry their own measure (see below), so the wrap itself
   stays full width and stays aligned with the header and the sections. */
.hero .eyebrow { color: #7dd3fc; }
.hero h1 { max-width: 16ch; }
.hero .lead { color: rgba(226,232,240,.88); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.hero-stats {
  display: grid; gap: 1.25rem; margin-top: 3.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.75rem;
}
.hero-stats li { display: flex; flex-direction: column; gap: .2rem; }
.hero-stats strong { font-size: 1.15rem; font-weight: 700; }
.hero-stats span { font-size: .92rem; color: rgba(226,232,240,.7); }
.stats-dark { border-top-color: var(--line); }
.stats-dark strong { color: var(--ink); }
.stats-dark span { color: var(--slate); }

/* --- Interior page heads ------------------------------------------------ */
.page-head {
  background: linear-gradient(160deg, #0b1220 0%, #16274a 100%);
  color: #fff; padding: clamp(3rem, 7vw, 4.75rem) 0;
}
.page-head .lead { color: rgba(226,232,240,.86); }
.page-head .eyebrow { color: #7dd3fc; }

/* --- Cards -------------------------------------------------------------- */
.card-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.9rem; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cbd8ea; }
.card h2, .card h3 { font-size: 1.2rem; }
.card p { color: var(--slate); font-size: .98rem; }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: 1.1rem;
  border-radius: 13px; background: var(--brand-wash); color: var(--brand);
}
.card-icon svg { width: 24px; height: 24px; }

.ticks { display: grid; gap: .5rem; margin-top: 1.1rem; }
.ticks li {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: .92rem; color: var(--ink-soft);
}
.ticks svg { width: 16px; height: 16px; flex: none; margin-top: .3rem; color: var(--brand); }
.ticks-lg li { font-size: 1rem; margin-bottom: .3rem; }

/* --- Steps -------------------------------------------------------------- */
.steps {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  counter-reset: step;
}
.steps li {
  position: relative; padding: 1.6rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
}
.step-no {
  display: block; margin-bottom: .6rem;
  font-size: .82rem; font-weight: 800; letter-spacing: .1em; color: var(--brand);
}
.steps p { margin: 0; color: var(--slate); font-size: .95rem; }

/* --- Work cards --------------------------------------------------------- */
.work-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.work-grid-wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.work-card {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.9rem; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cbd8ea; }
.work-card h2, .work-card h3 { font-size: 1.25rem; margin: 0; }
.work-card p { color: var(--slate); font-size: .97rem; margin: 0; }
.work-card .link-arrow { margin-top: auto; padding-top: .8rem; }

.tag {
  align-self: flex-start;
  padding: .28rem .7rem; border-radius: 999px;
  background: var(--brand-wash); color: var(--brand-dark);
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.chips li {
  padding: .25rem .65rem; border-radius: 999px;
  background: var(--paper-alt); border: 1px solid var(--line);
  font-size: .8rem; color: var(--slate);
}
.chips-light { margin-top: 1.25rem; }
.chips-light li { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #e2e8f0; }

/* --- Prose -------------------------------------------------------------- */
/* Same reason as .hero-inner: constrain the column, not the wrap, so the prose
   lines up with the page heading above it. */
.prose-wrap > * { max-width: 780px; }
.prose h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose > p:first-of-type { font-size: 1.07rem; }

.notice {
  padding: .95rem 1.15rem; margin-bottom: 2rem;
  background: var(--brand-wash); border-left: 4px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .95rem; color: var(--ink-soft);
}

.next-card {
  display: flex; flex-direction: column; gap: .2rem;
  margin-top: 3rem; padding: 1.5rem 1.8rem;
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: inherit;
}
.next-card:hover { border-color: #cbd8ea; background: #eef3fa; }
.next-card strong { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.next-card svg { width: 18px; height: 18px; color: var(--brand); }

/* --- Contact ------------------------------------------------------------ */
.contact-layout {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}
.contact-form {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.4rem); box-shadow: var(--shadow);
}
.field-row { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.field-row .field { margin-bottom: 0; }
.field-row + .field-row, .field-row + .field { margin-top: 1.1rem; }

label { font-size: .9rem; font-weight: 650; margin-bottom: .4rem; }
.req { color: var(--brand); }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; padding: .72rem .9rem;
  font: inherit; font-size: .97rem; color: var(--ink);
  background: var(--paper); border: 1px solid #cbd5e1; border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 140px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
[aria-invalid="true"] { border-color: var(--danger); }
.err { margin: .4rem 0 0; font-size: .85rem; color: var(--danger); }
.form-note { margin: 1rem 0 0; font-size: .85rem; color: var(--slate-soft); }

/* The honeypot must be invisible without being display:none — some bots
   skip fields that are not rendered at all. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-aside { display: grid; gap: 1.25rem; }
.aside-card {
  background: var(--paper-alt); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.6rem;
}
.aside-card h2 { font-size: 1.1rem; }
.contact-list { display: grid; gap: .8rem; margin-top: 1rem; }
.contact-list li { display: flex; align-items: center; gap: .65rem; font-size: .95rem; }
.contact-list svg { width: 19px; height: 19px; flex: none; color: var(--brand); }
.aside-note { margin: 1.1rem 0 0; font-size: .85rem; color: var(--slate-soft); }

.faqs { margin-top: .5rem; }
.faqs details { border-top: 1px solid var(--line); padding: .3rem 0; }
.faqs details:first-child { border-top: 0; }
.faqs summary {
  cursor: pointer; padding: .65rem 0; font-weight: 650; font-size: .95rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faqs summary::-webkit-details-marker { display: none; }
.faqs summary::after { content: "+"; color: var(--brand); font-weight: 700; }
.faqs details[open] summary::after { content: "−"; }
.faqs p { margin: 0 0 .9rem; font-size: .92rem; color: var(--slate); }

/* --- Flashes ------------------------------------------------------------ */
.flashes { padding-top: 1.25rem; }
.flash {
  margin: 0 0 .6rem; padding: .8rem 1.1rem; border-radius: var(--r-sm);
  font-size: .95rem; border: 1px solid;
}
.flash-error { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* --- Centred pages ------------------------------------------------------ */
.centred-page { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.centred-page .lead, .centred-page .hero-actions { margin-inline: auto; justify-content: center; }
.big-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; margin-bottom: 1.5rem;
  border-radius: 50%; background: #dcfce7; color: #16a34a;
}
.big-tick svg { width: 34px; height: 34px; }
.error-code {
  font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; line-height: 1;
  letter-spacing: -.04em; color: var(--brand-wash); margin: 0 0 .25rem;
}

/* --- CTA band ----------------------------------------------------------- */
.cta-band { background: linear-gradient(120deg, var(--brand-dark), #0369a1); color: #fff; }
.cta-inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.cta-inner h2 { margin: 0 0 .4rem; }
.cta-inner p { margin: 0; color: rgba(224,242,254,.9); max-width: 52ch; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #cbd5e1; padding-top: clamp(2.5rem, 6vw, 4rem); }
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  padding-bottom: 2.5rem;
}
.footer-brand strong { display: block; color: #fff; font-size: 1.3rem; font-weight: 800; margin-bottom: .5rem; }
.footer-brand p { font-size: .92rem; color: #94a3b8; max-width: 40ch; }
.site-footer h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: .9rem; }
.site-footer ul { display: grid; gap: .5rem; }
.site-footer li, .site-footer a { font-size: .92rem; color: #94a3b8; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  padding: 1.25rem 0; border-top: 1px solid rgba(255,255,255,.1);
}
.footer-bottom p { margin: 0; font-size: .85rem; color: #64748b; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; inset: 74px 0 auto;
    flex-direction: column; align-items: stretch; gap: .15rem;
    padding: 1rem 1.25rem 1.5rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .8rem .75rem; font-size: 1.02rem; }
  .nav-cta { margin: .5rem 0 0; justify-content: center; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .field-row .field + .field { margin-top: 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}
