/* ==========================================================================
   Binzard — main.css
   Shared design system: tokens, reset, typography, layout, and the
   components that appear on every page (header, footer, buttons, cards,
   forms).  Page-specific rules live in home.css / legal.css.

   Palette is taken from the live Binzard brand (Elementor global colours).
   Every text/background pair here has been checked against WCAG 2.2 AA.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Fonts */
/* Self-hosted latin subsets — no third-party request, simpler CSP.
   Inter ships as a variable font, so one file covers weights 100–900. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('../fonts/lato-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('../fonts/lato-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------- 2. Tokens */
:root {
  /* Brand — from --e-global-color-* on binzard.com */
  --c-violet:        #5525f1;   /* accent: FILLS ONLY. 2.44:1 as text on dark — never use for text */
  --c-violet-deep:   #5728dc;
  --c-blue:          #405cd1;
  --c-blue-deep:     #1d3598;
  --c-indigo:        #0e0637;
  --c-lavender:      #ad95ff;
  --c-gold:          #ebaf69;
  --c-slate:         #8e99ac;   /* the logo's own colour */

  /* Backgrounds */
  --bg-page:         #02040e;
  --bg-core:         #071348;
  --bg-surface:      rgba(14, 6, 55, 0.55);
  --bg-surface-solid:#0b1130;
  --bg-elevated:     rgba(255, 255, 255, 0.045);

  /* Text — contrast-verified against --bg-page / --bg-core / --bg-surface */
  --t-heading:       #ffffff;                        /* 17.6:1 */
  --t-body:          rgba(255, 255, 255, 0.78);      /* 10.9:1 */
  --t-muted:         rgba(255, 255, 255, 0.62);      /*  7.4:1 */
  --t-accent:        #c4b5ff;                        /*  9.5:1 — accent TEXT + links */
  --t-on-accent:     #ffffff;                        /*  7.2:1 on --c-violet */

  /* Lines & glow */
  --line:            rgba(255, 255, 255, 0.10);
  --line-strong:     rgba(255, 255, 255, 0.18);
  --glow-violet:     0 0 0 1px rgba(85, 37, 241, 0.35), 0 18px 50px -12px rgba(85, 37, 241, 0.45);

  /* Gradients */
  --grad-accent:     linear-gradient(135deg, #5525f1 0%, #405cd1 100%);
  --grad-page:       radial-gradient(120% 90% at 50% 0%, #0a1a55 0%, #071348 38%, #02040e 100%);
  --grad-band:       linear-gradient(180deg, rgba(29, 53, 152, 0.45) 0%, rgba(14, 6, 55, 0.25) 100%);

  /* Type */
  --f-display: 'Lato', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --fs-hero:  clamp(2.25rem, 1.45rem + 3.4vw, 4rem);
  --fs-h2:    clamp(1.75rem, 1.32rem + 1.85vw, 2.75rem);
  --fs-h3:    clamp(1.125rem, 1.05rem + 0.32vw, 1.3rem);
  --fs-lead:  clamp(1.0625rem, 1rem + 0.36vw, 1.25rem);
  --fs-body:  1rem;
  --fs-sm:    0.9375rem;
  --fs-xs:    0.8125rem;

  /* Spacing */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 2.5rem;   --sp-8: 3rem;
  --sp-9: 4rem;     --sp-10: 5rem;    --sp-11: 6rem;

  --section-y: clamp(3.5rem, 2rem + 6vw, 6.5rem);
  --gutter:    clamp(1.25rem, 4vw, 2rem);
  --maxw:      1200px;
  --maxw-prose: 68ch;

  /* Radii & shadows */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(85, 37, 241, 0.55);

  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--t-body);
  background-color: var(--bg-page);
  background-image: var(--grad-page);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

ul, ol { padding: 0; list-style: none; }

a { color: var(--t-accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: #ffffff; }

/* One consistent, always-visible focus ring. */
:focus-visible {
  outline: 3px solid var(--t-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------- 4. Typography */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--t-heading);
  text-wrap: balance;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; }

p { text-wrap: pretty; }

strong, b { color: var(--t-heading); font-weight: 600; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--t-body);
}

/* Small uppercase label that sits above a section heading. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-accent);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--grad-accent);
  border-radius: 2px;
}

/* -------------------------------------------------------------- 5. Layout */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem); }

/* Subtle blue wash to separate alternating sections. */
.section--band {
  background-image: var(--grad-band);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .eyebrow { justify-content: center; }
.section-head p { margin-top: var(--sp-4); font-size: var(--fs-lead); color: var(--t-muted); }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

/* Accessible hiding — content stays available to screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-violet);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--r-md) var(--r-md);
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

/* ------------------------------------------------------------- 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.8rem 1.6rem;
  min-height: 48px;              /* WCAG 2.2 target size */
  border-radius: var(--r-pill);
  font-family: var(--f-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--primary {
  background-image: var(--grad-accent);
  color: var(--t-on-accent);
  border: 1px solid transparent;
  box-shadow: 0 8px 24px -10px rgba(85, 37, 241, 0.85);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(85, 37, 241, 0.95);
}

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--t-heading);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  color: #fff;
  border-color: rgba(196, 181, 255, 0.6);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.btn--lg { padding: 1rem 2rem; font-size: var(--fs-body); min-height: 54px; }
.btn--block { width: 100%; }

.btn:active { transform: translateY(0); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.btn-row--center { justify-content: center; }

/* --------------------------------------------------------------- 7. Cards */
.card {
  position: relative;
  padding: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
              box-shadow 0.22s var(--ease);
}
.card h3 { margin-bottom: var(--sp-3); }
.card p  { color: var(--t-muted); font-size: var(--fs-sm); }

.card--interactive:hover {
  transform: translateY(-4px);
  border-color: rgba(173, 149, 255, 0.45);
  box-shadow: var(--shadow-lift);
}

/* Square glyph tile that heads most cards. */
.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: var(--sp-4);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(85, 37, 241, 0.5), rgba(64, 92, 209, 0.35));
  border: 1px solid rgba(173, 149, 255, 0.3);
  color: #fff;
  flex-shrink: 0;
}
.card-icon svg { width: 22px; height: 22px; }

/* Muted variant used by the secondary "Also offering" section so it reads
   as clearly subordinate to the voice-agent content above it. */
.card--quiet {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}
.card--quiet .card-icon {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--c-lavender);
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
}
.card--quiet .card-icon svg { width: 18px; height: 18px; }

/* Small pill used for statuses and inline facts. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--t-body);
}

/* -------------------------------------------------------------- 8. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(4, 8, 30, 0.82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--t-heading);
  flex-shrink: 0;
}
.brand img { width: 38px; height: 38px; }
.brand-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: var(--t-heading);
}
.brand:hover { color: var(--t-heading); }

.primary-nav { margin-left: auto; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1.75rem);
}
.primary-nav a {
  display: inline-block;
  padding: 0.5rem 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--t-body);
  text-decoration: none;
  white-space: nowrap;      /* six items + a CTA must never wrap to two lines */
  transition: color 0.16s var(--ease);
}
.primary-nav a:hover,
.primary-nav a[aria-current='page'] { color: #fff; }
.primary-nav a[aria-current='page'] { font-weight: 600; }

.header-cta { flex-shrink: 0; }

/* Hamburger — hidden until the nav collapses at 1080px. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  color: var(--t-heading);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-open  { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin-left: 0;
    padding: var(--sp-5) var(--gutter) var(--sp-7);
    background: #060a24;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.8);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    /* Collapsed by default; .is-open is toggled by js/site.js */
    display: none;
  }
  .primary-nav.is-open { display: block; }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .primary-nav li + li { border-top: 1px solid var(--line); }
  .primary-nav a {
    padding: 0.95rem 0.25rem;
    font-size: 1.0625rem;
  }

  .header-cta { display: none; }
  .primary-nav .nav-cta { display: block; margin-top: var(--sp-5); }
  .primary-nav .nav-cta .btn { width: 100%; }
}

@media (min-width: 1081px) {
  .primary-nav .nav-cta { display: none; }
}

/* Locks background scroll while the mobile menu is open. */
body.nav-open { overflow: hidden; }

/* Form components live in contact.css — only the contact page has a form. */

/* --------------------------------------------------------------- 9. Footer */
.site-footer {
  margin-top: var(--section-y);
  padding-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 6, 55, 0.25), rgba(2, 4, 14, 0.85));
  font-size: var(--fs-sm);
}

.footer-grid {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
}

.footer-brand .brand { margin-bottom: var(--sp-4); }
.footer-tagline { color: var(--t-muted); max-width: 34ch; }

.footer-social {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--t-body);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
              background-color 0.16s var(--ease);
}
.footer-social a:hover {
  color: #fff;
  border-color: rgba(173, 149, 255, 0.55);
  background: var(--bg-elevated);
}
.footer-social svg { width: 19px; height: 19px; }

.footer-col h2 {
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-heading);
  margin-bottom: var(--sp-4);
}
.footer-col li + li { margin-top: var(--sp-3); }
.footer-col a {
  color: var(--t-muted);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-contact li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--t-muted);
}
.footer-contact svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--c-lavender);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--t-muted);
  font-size: var(--fs-xs);
}
.footer-bottom p { margin: 0; }

/* ------------------------------------------------- 10. Motion preferences */
/* Scroll reveal.

   The hidden state is scoped to html.reveal-ready, a class site.js adds only
   after it has confirmed it can actually run the observer. Content is
   therefore VISIBLE BY DEFAULT: if the script is blocked, fails to parse, or
   errors before setup, nothing is left stranded at opacity 0. Never move the
   hidden state onto the bare [data-reveal] selector. */
[data-reveal] {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}
html.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1; transform: none; }
}
