/* ═══════════════════════════════════════════════════════════════════
   Capetec — shared site styles
   ───────────────────────────────────────────────────────────────────
   Loaded by every page. Anything used by only one page belongs in
   /css/<page>.css instead, so this file stays the single place a
   token, the nav, or the footer is edited.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design tokens ─── */
:root {
  --bg:        #f5f7fa;
  --bg2:       #eef1f6;
  --bg3:       #e4e9f2;
  --border:    rgba(0,0,0,0.08);
  --accent:    #0077b6;
  --accent2:   #005f92;
  --accent3:   #00b4d8;
  --text:      #111827;
  --text-body: #4a5a72;   /* body copy — softer than --text, darker than --muted */
  --muted:     #5a6a82;
  --card:      #ffffff;
  /* Error and success are the darker ends of their ramps so they clear
     4.5:1 as text and 3:1 as a border. The old #f87171 managed neither,
     and #dc2626 fell just short (4.41) on the tinted error banner. */
  --error:     #c81e1e;
  --success:   #166534;
  --radius:    12px;
  --font:      'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Typography ─── */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -1px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.5px; }
h3 { font-size: 1.15rem; }
p  { color: var(--text-body); }

/* ─── Layout helpers ─── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 96px 0; }
.section-sm { padding: 64px 0; }

.divider {
  width: 48px; height: 3px; background: var(--accent);
  border-radius: 2px; margin: 16px 0 28px;
}

.label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* Small utilities, so pages don't need inline style attributes. */
.measure { max-width: 600px; }
.mb-16   { margin-bottom: 16px; }

/* Two-column content shell. Each page sets its own column widths. */
.content-wrap {
  display: grid; gap: 48px;
  padding: 64px 0 96px;
  align-items: start;
}

/* ─── Buttons ─── */
.btn-primary {
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 14px 32px; border-radius: 10px; font-size: 1rem;
  transition: background .2s, transform .15s; display: inline-block;
}
/* Hover darkens rather than lightens: white on --accent3 is 2.46:1.
   This also matches .btn-submit:hover, which already used --accent2. */
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); text-decoration: none; }

.btn-outline {
  border: 1px solid rgba(0,0,0,0.15); color: var(--text);
  padding: 14px 32px; border-radius: 10px; font-size: 1rem; font-weight: 600;
  transition: border-color .2s, transform .15s; display: inline-block;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); text-decoration: none; }

/* ─── NAV ───
   The shell is shared. The home page fills it with a link bar plus a
   mobile drawer; sub-pages fill it with a single "back to home" link.
   Scoped to .site-nav, not the bare element, so in-page <nav> blocks
   (the privacy TOC, and later a blog post's contents) stay unstyled. */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(245,247,250,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px;
}
.nav-logo {
  font-size: 1.5rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo span { color: var(--accent); }

/* Home: full link bar */
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.9rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 8px 20px; border-radius: 8px; font-weight: 700;
  font-size: 0.85rem; transition: background .2s, transform .15s;
}
.nav-cta:hover { background: var(--accent2); transform: translateY(-1px); text-decoration: none !important; }

.nav-hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; cursor: pointer; padding: 6px; background: none;
  border: none; border-radius: 6px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Home: mobile drawer */
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: rgba(245,247,250,0.98); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  flex-direction: column; padding: 16px 24px 24px;
  gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--text); font-size: 1rem; font-weight: 500;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  display: block;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu .mob-cta {
  margin-top: 12px; background: var(--accent); color: #fff !important;
  text-align: center; padding: 12px; border-radius: 8px;
  font-weight: 700; border-bottom: none;
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* Sub-pages: single back link */
.nav-back {
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px; transition: color .2s;
}
.nav-back:hover { color: var(--accent); text-decoration: none; }
.nav-back svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── PAGE HEADER (sub-pages) ─── */
.page-header {
  padding: 120px 0 56px;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0,119,182,0.07) 0%, transparent 70%),
              var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-header .label { margin-bottom: 14px; }
.page-header h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.5px;
  line-height: 1.15; margin-bottom: 16px;
}

/* ─── FOOTER ─── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
}
.footer-logo { font-size: 1.2rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.footer-logo:hover { text-decoration: none; }
.footer-logo span { color: var(--accent); }
.footer-copy { font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.82rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ─── Scroll-reveal ───
   Scoped to .js, which /js/head.js adds before first paint. Without
   JS the class never lands, so the content renders plainly visible
   instead of staying at opacity 0 — important now that articles,
   not just marketing copy, will use .reveal. */
.js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ─── Animations ─── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin  { to { transform: rotate(360deg); } }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.visible { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  .btn-primary:hover, .btn-outline:hover, .nav-cta:hover { transform: none; }
}

/* ─── Shared small-screen rules ───
   The three pages previously stacked the footer at different widths
   (540px on enquire, 480px elsewhere). Unified on 540px: a row footer
   at ~500px puts the logo, copyright line and links uncomfortably
   close together. */
@media (max-width: 540px) {
  .page-header { padding: 100px 0 40px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 480px) {
  .section    { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
}
