/*
  LexVerity Legal Ltd — corporate site stylesheet
  ------------------------------------------------
  Ported from the LexVerity Academy design system
  (sqe-tool/marketing/src/styles/{tokens,global}.css) so the corporate site and
  the Academy read as one brand. Palette, type scale, spacing and motion are
  copied verbatim; the only deliberate divergences are noted inline and exist to
  distinguish the consulting company from the study product.

  Design intent (inherited): light-only, high-contrast, typographic. White is the
  primary surface, the brand's deep navy is the single accent, and one grotesque
  carries the hierarchy through weight and size rather than decoration. Big,
  certain statements; generous whitespace; very little chrome.
*/

/* ---- Self-hosted General Sans (same files the Academy ships) ------------- */
@font-face {
  font-family: 'General Sans';
  src: url('/fonts/general-sans/general-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/fonts/general-sans/general-sans-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/fonts/general-sans/general-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/fonts/general-sans/general-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- Palette (verbatim from the Academy) ------------------------------ */
  --color-paper: #ffffff;
  --color-paper-alt: #f5f5f7;
  --color-ink: #14151a;
  --color-ink-soft: #4b5563;
  --color-ink-faint: #7c8492;

  --color-accent: #16294a;
  --color-accent-strong: #0e1c33;
  --color-accent-soft: #e8ecf1;
  --color-brass: #6b7280;
  --color-brass-soft: #f2f2f4;

  --color-border: rgba(20, 21, 26, 0.12);
  --color-border-soft: rgba(20, 21, 26, 0.07);

  --color-success: #29684a;
  --color-success-soft: #e7f1ea;

  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(20, 21, 26, 0.06);
  --glass-blur: 20px;
  --shadow-card: 0 1px 2px rgba(20, 21, 26, 0.04), 0 4px 16px -10px rgba(20, 21, 26, 0.1);

  /* ---- Type ------------------------------------------------------------- */
  --font-display: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-display-xl: clamp(2.75rem, 1.7rem + 5.2vw, 6.5rem);
  --text-display-lg: clamp(2.25rem, 1.55rem + 3.6vw, 4.5rem);
  --text-display-md: clamp(1.75rem, 1.4rem + 1.8vw, 2.75rem);
  --text-display-sm: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --text-body-lg: clamp(1.125rem, 1.03rem + 0.4vw, 1.375rem);
  --text-body-md: 1.0625rem;
  --text-body-sm: 0.9375rem;
  --text-caption: 0.8125rem;

  --leading-tight: 1.03;
  --leading-snug: 1.18;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  --tracking-tighter: -0.045em;
  --tracking-tight: -0.025em;
  --tracking-wide: 0.06em;

  /* ---- Spacing ---------------------------------------------------------- */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;    --space-24: 6rem;
  --space-32: 8rem;    --space-40: 10rem;

  --content-max: 72rem;
  --content-narrow: 44rem;

  /* ---- Radii ------------------------------------------------------------ */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  /* Buttons follow the study dashboard's canonical shape, not the rounder
     marketing scale above. Mirrors app/src/index.css --radius-md (6px). */
  --radius-btn: 6px;

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 160ms;
  --duration-base: 320ms;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-10); }
}

.narrow { max-width: var(--content-narrow); }

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

.display-xl { font-size: var(--text-display-xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tighter); font-weight: 600; }
.display-lg { font-size: var(--text-display-lg); line-height: var(--leading-tight); letter-spacing: var(--tracking-tighter); font-weight: 600; }
.display-md { font-size: var(--text-display-md); }
.display-sm { font-size: var(--text-display-sm); }

.lead {
  font-size: var(--text-body-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-soft);
  text-wrap: pretty;
}

p { text-wrap: pretty; }
p + p { margin-top: var(--space-4); }

a { color: var(--color-accent); }

.eyebrow {
  display: inline-block;
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-brass);
  margin-bottom: var(--space-4);
}

.pill {
  display: inline-block;
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-brass);
  background: var(--color-brass-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.pill-live { color: var(--color-success); background: var(--color-success-soft); }

/* ---- Buttons (canonical dashboard shape) -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: var(--text-body-sm);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration-fast) var(--ease-out),
    background-color var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-accent); color: var(--color-paper); }
.btn-primary:hover { background: var(--color-accent-strong); }
.btn-secondary { background: transparent; color: var(--color-ink); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-ink); background: var(--color-paper-alt); }

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}

.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 72px;
}

/* text-decoration/colour reset: the whole lockup is wrapped in an <a>, and
   without this the "Legal Ltd" suffix renders underlined and in link blue. */
.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
/* 34px in the header, 44px in the footer — the same sizes the Academy uses.
   Below ~34px the wordmark under the monogram stops being legible. */
.brand-logo { flex-shrink: 0; height: 34px; width: auto; display: block; }
.site-footer .brand-logo { height: 44px; }

/* Distinguishes the consulting company from the Academy without a second logo:
   a hairline rule and the practice name set in small caps beside the mark. */
.brand-suffix {
  margin-left: var(--space-3);
  padding-left: var(--space-3);
  border-left: 1px solid var(--color-border);
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  white-space: nowrap;
}

.nav-links { display: none; gap: var(--space-8); }
.nav-links a { color: var(--color-ink-soft); text-decoration: none; font-size: var(--text-body-sm); font-weight: 500; }
.nav-links a:hover { color: var(--color-ink); }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

@media (min-width: 900px) {
  .nav-links { display: flex; }
}

/* ---- Sections ----------------------------------------------------------- */
.section { padding-block: var(--space-24); }
.section-tight { padding-block: var(--space-16); }
.section-alt { background: var(--color-paper-alt); }
.hero { padding-block: var(--space-32) var(--space-24); }

.rule { border: 0; border-top: 1px solid var(--color-border); margin-block: var(--space-16); }

/* ---- Cards / grids ------------------------------------------------------ */
.grid { display: grid; gap: var(--space-6); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.card h3 { font-size: var(--text-display-sm); }
.card p { color: var(--color-ink-soft); }
.card .btn { align-self: flex-start; margin-top: auto; }

/* ---- Prose (guides, blog) ----------------------------------------------- */
.prose { max-width: var(--content-narrow); }
.prose h2 { font-size: var(--text-display-sm); margin-top: var(--space-12); margin-bottom: var(--space-4); }
.prose h3 { font-size: var(--text-body-lg); margin-top: var(--space-8); margin-bottom: var(--space-3); }
.prose p { color: var(--color-ink-soft); line-height: var(--leading-relaxed); }
.prose ul, .prose ol { margin: var(--space-4) 0 var(--space-4) var(--space-6); color: var(--color-ink-soft); }
.prose li { margin-bottom: var(--space-2); line-height: var(--leading-relaxed); }
.prose a { color: var(--color-accent); }

.callout {
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-soft);
  padding: var(--space-5) var(--space-6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-block: var(--space-8);
}
.callout p { color: var(--color-ink); font-size: var(--text-body-sm); }

/* ---- Definition list ---------------------------------------------------- */
.details-grid { display: grid; gap: var(--space-8); }
@media (min-width: 640px) { .details-grid { grid-template-columns: repeat(2, 1fr); } }
.details-grid dt { font-size: var(--text-caption); color: var(--color-ink-faint); margin-bottom: var(--space-1); }
.details-grid dd { font-size: var(--text-body-md); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--color-border); padding-block: var(--space-16) var(--space-10); }
.footer-grid { display: grid; gap: var(--space-10); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-col h4 { font-size: var(--text-caption); letter-spacing: var(--tracking-wide); text-transform: uppercase; margin-bottom: var(--space-4); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col a { color: var(--color-ink-soft); text-decoration: none; font-size: var(--text-body-sm); }
.footer-col a:hover { color: var(--color-ink); }
.footer-note { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--color-border); font-size: var(--text-caption); color: var(--color-ink-faint); line-height: var(--leading-relaxed); }

/* ---- Forms -------------------------------------------------------------- */
.field {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: var(--text-body-sm);
  background: var(--color-paper);
}
.field:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: transparent; }

/* ---- Consent bar -------------------------------------------------------- */
.consent-bar {
  position: fixed;
  inset-inline: var(--space-4);
  bottom: var(--space-4);
  z-index: 100;
  max-width: 34rem;
  margin-inline: auto;
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.consent-bar p { font-size: var(--text-body-sm); color: var(--color-ink-soft); }
.consent-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ---- Mobile nav --------------------------------------------------------- */
.mobile-nav { display: none; flex-direction: column; gap: var(--space-3); padding-block: var(--space-5); border-top: 1px solid var(--color-border); }
.mobile-nav[data-open='true'] { display: flex; }
.mobile-nav a { color: var(--color-ink-soft); text-decoration: none; font-size: var(--text-body-sm); font-weight: 500; }
.mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-body-sm);
  color: var(--color-ink);
}
@media (min-width: 900px) { .mobile-nav, .mobile-nav-toggle { display: none !important; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
