/* ================================================================
   RevPIQ - base (v4): reset, type, buttons, header, footer, crest swap, theme toggle
   Shared by every page. Page-specific layout lives in site.css.
   ================================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  /* v4: the whole page sits ~10% further back ("zoomed out") */
  font-size: 96.875%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* Headlines: Archivo, a sturdy grotesque set a touch wide for an
   athletic, confident voice. (Bricolage Grotesque is kept for the
   RevPIQ wordmark only.) */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 104%;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; font-stretch: 108%; letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: var(--fs-h2); font-weight: 750; font-stretch: 106%; letter-spacing: -0.02em; line-height: 1.06; }
h3 { font-size: var(--fs-h3); line-height: 1.15; }
h4 { font-size: var(--fs-h4); line-height: 1.25; letter-spacing: -0.005em; }

p { margin: 0; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
p + p { margin-top: var(--s-4); }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

strong { color: var(--ink); font-weight: 600; }

ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--gold-25); color: var(--ink); }

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

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-5);
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 700;
  border-radius: var(--r-md);
  text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Placeholder copy the team still has to supply */
.ph {
  color: var(--gold-ink);
  background: var(--gold-12);
  border: 1px dashed var(--gold-40);
  border-radius: var(--r-sm);
  padding: 0 6px;
  font-style: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-normal) var(--ease), border-color var(--t-normal) var(--ease),
    box-shadow var(--t-normal) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-gold {
  color: var(--ink-on-gold);
  background: linear-gradient(180deg, var(--gold-hover) 0%, var(--gold) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--accent-25);
}
.btn-gold:hover {
  color: var(--ink-on-gold);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-hover) 70%, white) 0%, var(--accent-hover) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 20px var(--accent-25), 0 0 0 1px var(--accent-40);
}

.btn-line {
  color: var(--ink);
  background: var(--bg-2);
  border-color: var(--line);
}
.btn-line:hover { color: var(--ink); background: var(--bg-3); border-color: var(--line-strong); }

.btn-quiet {
  color: var(--ink-2);
  background: transparent;
  padding: 0 var(--s-4);
}
.btn-quiet:hover { color: var(--ink); background: var(--hover); }

.btn-sm { min-height: 40px; padding: 0 var(--s-4); font-size: 0.9375rem; }

/* ---------------------------------------------------------------
   Brand lock-up
   --------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand img { width: 28px; height: auto; }
.wordmark {
  font-family: var(--font-logo);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
/* The "IQ" takes the accent (gold on white, yellow on indigo), carrying on the old wordmark's gold A + I */
.wordmark b { color: var(--gold-logo); font-weight: 800; }

/* ---------------------------------------------------------------
   Site header
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-subtle);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: 64px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-left: auto;
}
.site-nav a {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); background: var(--hover); }
.site-actions { display: flex; align-items: center; gap: var(--s-2); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-header .wrap { flex-wrap: wrap; gap: var(--s-3); }
  .site-nav,
  .site-actions { display: none; }
  .site-header.is-open .site-nav,
  .site-header.is-open .site-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
  }
  .site-header.is-open .site-nav { padding-top: var(--s-2); border-top: 1px solid var(--line-subtle); }
  .site-header.is-open .site-nav a { padding: var(--s-3) var(--s-2); font-size: 1rem; }
  .site-header.is-open .site-actions { padding-bottom: var(--s-4); }
  .site-header.is-open .site-actions .btn { width: 100%; }
  .site-header.is-open .site-actions .theme-toggle { align-self: flex-start; margin-bottom: var(--s-2); }
}

/* ---------------------------------------------------------------
   Crest: GOLD on white (the light theme), YELLOW on indigo (dark).
   Big crests on white use the indigo-filled shield, so the yellow
   sits on indigo there too.
   --------------------------------------------------------------- */
[data-theme='dark'] .logo-light,
:root:not([data-theme='dark']) .logo-dark { display: none; }

/* ---------------------------------------------------------------
   Theme toggle (light / dark)
   --------------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-toggle:hover { color: var(--ink); background: var(--hover); }
.theme-toggle .i-sun { display: none; }
[data-theme='dark'] .theme-toggle .i-sun { display: block; }
[data-theme='dark'] .theme-toggle .i-moon { display: none; }

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */
.section { padding-block: var(--section-pad); }
.section-head { display: grid; gap: var(--s-4); margin-bottom: clamp(28px, 4vw, 52px); }
.section-head p { font-size: var(--fs-lead); line-height: 1.5; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  padding-block: var(--s-12) var(--s-10);
  border-top: 1px solid var(--line-subtle);
  color: var(--ink-3);
  font-size: var(--fs-small);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-6); }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { color: var(--ink-3); font-size: var(--fs-small); }
.footer-connect { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); }
/* LinkedIn: same colour, weight and size as the other footer links */
.site-footer .footer-linkedin { display: inline-flex; align-items: center; gap: 0.45em; }
.footer-linkedin svg { flex: none; width: 1.15em; height: 1.15em; }

/* ---------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
