/* ==========================================================================
   base.css: STRUCTURE ONLY. Every site gets the same working skeleton.
   The visual identity lives in assets/css/style.css, which loads AFTER this file
   and overrides the tokens below. Do not put brand styling in this file.
   ========================================================================== */

:root {
  /* tokens: override these in style.css */
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5b6472;
  --line: #e4e7ec;
  --brand: #2f5bea;
  --brand-ink: #ffffff;

  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font-body);

  --header-h: 76px;
  --radius: 12px;
  --radius-pill: 999px;
  --container: 1180px;
  --gutter: 24px;
  --section-y: 96px;

  /* header text colour while transparent over the hero (set light for dark heroes) */
  --header-fg-top: var(--text);
}

/* ---- reset and guards -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* anchor links (#section) must land BELOW the fixed header */
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
/* grid/flex children must be allowed to shrink or they overflow on phones */
.container > *, [class*="grid"] > *, [class*="layout"] > * { min-width: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: var(--section-y) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 13px 28px;
  border-radius: var(--radius-pill); border: 1.5px solid transparent;
  font: 600 0.95rem/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); }
.btn.is-loading { opacity: .7; pointer-events: none; }

/* ==========================================================================
   Header. FIXED (not sticky): transparent at the top, background after scroll.
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  color: var(--header-fg-top);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, color .3s ease;
}
.site-header.is-scrolled {
  color: var(--text);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }

/* logo: each word its own nowrap span so it can never break mid-name */
.logo { display: inline-flex; align-items: baseline; gap: .3em; flex: none; white-space: nowrap; font: 700 1.3rem/1 var(--font-display); letter-spacing: -.01em; }
.logo > span { white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav ul { display: flex; gap: 32px; }
/* scoped to the list: a broad ".main-nav a" would also restyle the CTA button */
.main-nav ul a { position: relative; display: inline-block; padding: 6px 0; font-weight: 500; font-size: .96rem; opacity: .85; transition: opacity .2s ease; }
.main-nav ul a:hover, .main-nav ul a.active { opacity: 1; }
.mobile-nav-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 14px; }

/* hamburger built from 3 bars, no icon font needed */
.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; background: none; border: 0; cursor: pointer; color: inherit; position: relative; }
.nav-toggle .bar { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease, top .25s ease; }
.nav-toggle .bar:nth-child(1) { top: 15px; }
.nav-toggle .bar:nth-child(2) { top: 21px; }
.nav-toggle .bar:nth-child(3) { top: 27px; }
.nav-toggle.is-open .bar:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle.is-open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  :root { --header-h: 68px; --section-y: 64px; }

  /* PITFALL: backdrop-filter on the header makes a position:fixed child measure
     against the header, so the open menu got cut in half once scrolled.
     On mobile the scrolled header is a solid colour instead. */
  .site-header.is-scrolled {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: var(--bg);
  }
  /* an open menu always needs a solid bar behind the logo and X */
  body.nav-open .site-header { background: var(--bg); color: var(--text); border-bottom-color: var(--line); }

  .nav-toggle { display: block; }
  .header-cta { display: none; }

  .main-nav {
    position: fixed; z-index: 200;
    top: var(--header-h); right: 0; bottom: 0; left: 0;   /* explicit offsets, not inset */
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 24px var(--gutter) 40px;
    background: var(--bg); color: var(--text);
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
    border-top: 1px solid var(--line);
  }
  .main-nav.open { transform: translateX(0); visibility: visible; transition: transform .3s ease; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul a { display: block; padding: 16px 4px; font-size: 1.1rem; opacity: 1; border-bottom: 1px solid var(--line); }
  .mobile-nav-cta { display: inline-flex; margin-top: 24px; width: 100%; }
}

/* ==========================================================================
   Page header (inner pages) and generic helpers
   ========================================================================== */
.page-header { padding: calc(var(--header-h) + 56px) 0 56px; text-align: center; background: var(--bg-alt); }
.breadcrumb { margin-top: 10px; font-size: .88rem; color: var(--muted); }
.breadcrumb a { color: var(--brand); }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head p { color: var(--muted); }

[data-reveal] { transition: opacity .7s ease, transform .7s ease; }
.js [data-reveal] { opacity: 0; transform: translateY(22px); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 64px 0 0; border-top: 1px solid var(--line); background: var(--bg); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 48px; }
.footer-brand p { color: var(--muted); font-size: .92rem; max-width: 280px; margin-top: 12px; }
.footer-col h4 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a, .footer-contact li { color: var(--muted); font-size: .92rem; }
.footer-col a:hover { color: var(--brand); }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact i { color: var(--brand); margin-top: 3px; flex: none; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.footer-social a:hover { color: var(--brand); border-color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 22px 0; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-bottom-links a:hover { color: var(--brand); }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
}

/* ==========================================================================
   Forms and the contact layout
   ========================================================================== */
.contact-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px; align-items: start; }
.contact-info-card, .contact-form-card { padding: 36px; border-radius: calc(var(--radius) * 1.5); border: 1px solid var(--line); background: var(--surface); }
.info-list { display: flex; flex-direction: column; gap: 22px; margin-top: 24px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list strong { display: block; font-size: .92rem; }
.info-list span, .info-list a { color: var(--muted); font-size: .92rem; }
.info-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--brand); }
.map-frame { display: block; width: 100%; height: 320px; border: 0; border-radius: calc(var(--radius) * 1.5); margin-top: 28px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label, .label { font-size: .88rem; font-weight: 600; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .96rem; color: var(--text);
  padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
}
textarea { resize: vertical; min-height: 130px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i:first-child { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon-wrap input, .input-icon-wrap select { padding-left: 42px; }
.select-wrap select { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer; }
.select-caret { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.radio-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: .9rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.radio-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.radio-pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.textarea-wrap { position: relative; }
.char-counter { position: absolute; right: 12px; bottom: 10px; font-size: .75rem; color: var(--muted); }
.field-error { min-height: 1em; font-size: .82rem; color: #c0392b; }
.form-group.has-error input, .form-group.has-error select, .form-group.has-error textarea { border-color: #c0392b; }
.form-note { margin-top: 14px; font-size: .85rem; color: var(--muted); }
.form-note a { color: var(--brand); }
/* spam honeypot: real users never see or fill this */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 22px; font-size: .92rem; }
.alert-success { background: #e8f7ee; color: #1b6b3a; border: 1px solid #bfe6cc; }
.alert-error { background: #fdeceb; color: #a8322a; border: 1px solid #f3c6c2; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .contact-info-card, .contact-form-card { padding: 26px 22px; }
}

/* ==========================================================================
   Legal pages and 404
   ========================================================================== */
.legal-content { max-width: 760px; margin: 0 auto; }
.legal-content .updated { font-size: .88rem; color: var(--muted); margin-bottom: 36px; }
.legal-content h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--muted); }
.legal-content ul { list-style: disc; padding-left: 22px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.legal-content a { color: var(--brand); font-weight: 600; }
.error-code { font: 700 clamp(5rem, 18vw, 10rem)/1 var(--font-display); color: var(--brand); }

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
