/* Quantrim — site stylesheet
   Entry point. Tokens first, then base, then components.
   Built to the Kestrel Design-System-Build standard: token-driven,
   hairline borders over shadows, restrained motion, 1200px container. */

@import url("tokens/colors.css");
@import url("tokens/typography.css");
@import url("tokens/spacing.css");
@import url("tokens/effects.css");

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection-bg); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--link); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--link-hover); text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--focus-shadow); border-radius: var(--r-sm); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-fg);
  padding: var(--sp-2) var(--sp-4); border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-6); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--sp-6); }

/* ── Micro label ──────────────────────────────────────────── */
.micro-label {
  font-size: var(--text-micro);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}
.inverse .micro-label { color: var(--inverse-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-body); font-size: var(--text-body); font-weight: var(--weight-semibold);
  line-height: 1; padding: 0 var(--sp-5); height: 44px;
  border-radius: var(--r-md); border: var(--border-w) solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg-faint); color: var(--fg); background: var(--bg-subtle); }
.btn-inverse { background: var(--q-white); color: var(--q-navy); }
.btn-inverse:hover { background: var(--q-mist); color: var(--q-navy); }
.btn-outline-inverse { background: transparent; color: var(--inverse-fg); border-color: rgba(255,255,255,0.28); }
.btn-outline-inverse:hover { border-color: rgba(255,255,255,0.55); color: var(--inverse-fg); }
.btn-sm { height: 36px; padding: 0 var(--sp-4); font-size: var(--text-small); }
.btn-lg { height: 50px; padding: 0 var(--sp-6); font-size: var(--text-body-lg); }

/* ── Header / nav ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--q-ink) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-w) solid var(--q-navy-700);
}
.site-header .container {
  height: 100%; display: flex; align-items: center; gap: var(--sp-8);
}
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--fg); }
.brand:hover { text-decoration: none; color: var(--fg); }
.brand img { height: 34px; width: auto; }
.brand span { font-size: 19px; font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }

/* Dark nav: white brand, light links */
.site-header .brand, .site-header .brand:hover { color: var(--q-white); }

.site-nav { display: flex; align-items: center; gap: var(--sp-6); margin-left: auto; }
.site-nav a {
  font-size: var(--text-small); font-weight: var(--weight-medium);
  color: var(--inverse-muted);
}
.site-nav a:hover { color: var(--q-white); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--q-white); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: var(--border-w) solid var(--q-navy-700); border-radius: var(--r-md);
  width: 40px; height: 40px; cursor: pointer; color: var(--q-white);
  align-items: center; justify-content: center;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--q-ink); border-bottom: var(--border-w) solid var(--q-navy-700);
    padding: var(--sp-2) var(--sp-6) var(--sp-4);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: var(--sp-3) 0; border-bottom: var(--border-w) solid var(--q-navy-700); }
  .site-nav .btn { margin-top: var(--sp-3); }
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--bg-section); color: var(--fg);
  border-bottom: var(--border-w) solid var(--border);
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--sp-12); align-items: center;
  padding: var(--sp-20) 0;
}
.hero h1 {
  font-size: var(--text-display-xl); font-weight: var(--weight-black);
  line-height: var(--leading-tight); color: var(--fg);
}
.hero p.lede { margin-top: var(--sp-5); font-size: var(--text-body-lg); color: var(--fg-muted); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.hero-media img { border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.hero-note { margin-top: var(--sp-5); font-size: var(--text-small); color: var(--fg-muted); }
.hero-note a { color: var(--link); text-decoration: underline; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding: var(--sp-16) 0; }
}

/* Page hero (interior pages) */
.page-hero { background: var(--inverse-bg); color: var(--inverse-fg); padding: var(--sp-16) 0; }
.page-hero h1 { font-size: var(--text-display); font-weight: var(--weight-bold); color: var(--q-white); }
.page-hero p { margin-top: var(--sp-4); color: var(--inverse-muted); max-width: 62ch; font-size: var(--text-body-lg); }

/* ── CTA band ─────────────────────────────────────────────── */
.cta-band { background: var(--accent); color: var(--accent-fg); }
.cta-band .container {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
  padding-top: var(--sp-5); padding-bottom: var(--sp-5); flex-wrap: wrap;
}
.cta-band p { font-weight: var(--weight-medium); font-size: var(--text-body-lg); }
@media (max-width: 640px) { .cta-band .container { justify-content: center; text-align: center; } }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: var(--sp-20) 0; }
.section-subtle { background: var(--bg-section); }
.section-inverse { background: var(--inverse-bg); color: var(--inverse-fg); }
.section-head { max-width: 640px; margin-bottom: var(--sp-10); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 34px); font-weight: var(--weight-bold); }
.section-head .micro-label { display: block; margin-bottom: var(--sp-3); }
.section-head p { margin-top: var(--sp-4); color: var(--fg-muted); font-size: var(--text-body-lg); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
  transition: box-shadow var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.card.hoverable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* Agent cards */
.agent-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.agent-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.agent-media { position: relative; aspect-ratio: 16 / 10; background: var(--q-ink); }
.agent-media video { width: 100%; height: 100%; object-fit: cover; }
.agent-body { padding: var(--sp-6); display: flex; flex-direction: column; flex: 1; }
.agent-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.agent-body h3 { font-size: 22px; font-weight: var(--weight-bold); }
.agent-body .role { color: var(--accent); font-weight: var(--weight-semibold); font-size: var(--text-small); margin-top: 2px; }
.agent-body ul { margin: var(--sp-4) 0 var(--sp-6); padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.agent-body ul li { padding-left: var(--sp-5); position: relative; color: var(--fg-muted); font-size: var(--text-small); }
.agent-body ul li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--accent);
}
.agent-body .btn { margin-top: auto; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-micro); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--accent); background: var(--accent-subtle);
  border-radius: var(--r-sm); padding: 4px 8px;
}

/* Numbered feature list */
.feature-card .num {
  font-size: var(--text-small); font-weight: var(--weight-bold);
  color: var(--accent); background: var(--accent-subtle);
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-4);
}
.feature-card h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); }
.feature-card p { margin-top: var(--sp-2); color: var(--fg-muted); font-size: var(--text-small); }

/* Testimonials */
.quote-card figure { margin: 0; }
.quote-card blockquote { margin: 0; font-size: var(--text-body); color: var(--fg); line-height: var(--leading-body); }
.quote-card figcaption { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); }
.quote-card figcaption img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.quote-card .who strong { display: block; font-size: var(--text-small); font-weight: var(--weight-semibold); }
.quote-card .who span { font-size: var(--text-micro); color: var(--fg-muted); text-transform: uppercase; letter-spacing: var(--tracking-label); }

/* Blog cards */
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-card a.thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.post-card a.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.post-card:hover a.thumb img { transform: scale(1.03); }
.post-card .post-body { padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.post-card h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: 1.4; }
.post-card h3 a { color: var(--fg); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card time { font-size: var(--text-small); color: var(--fg-faint); margin-top: auto; }

/* ── Article (blog post / legal) ──────────────────────────── */
.article { padding: var(--sp-16) 0 var(--sp-20); }
.article-header { margin-bottom: var(--sp-10); }
.article-header h1 { font-size: clamp(28px, 4vw, 38px); font-weight: var(--weight-bold); }
.article-header .meta { margin-top: var(--sp-4); display: flex; gap: var(--sp-3); align-items: center; color: var(--fg-faint); font-size: var(--text-small); }
.article-hero-img { border-radius: var(--r-xl); margin-bottom: var(--sp-10); box-shadow: var(--shadow-md); }
.prose { font-size: var(--text-body-lg); }
.prose p { margin: 0 0 var(--sp-5); }
.prose h2 { font-size: var(--text-h2); font-weight: var(--weight-bold); margin: var(--sp-10) 0 var(--sp-4); }
.prose h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); margin: var(--sp-8) 0 var(--sp-3); }
.prose ul, .prose ol { margin: 0 0 var(--sp-5); padding-left: var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); }
.prose strong { font-weight: var(--weight-semibold); }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-size: var(--text-small); font-weight: var(--weight-medium); margin-bottom: var(--sp-2); }
label .req { color: var(--q-danger); }

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; font-family: var(--font-body); font-size: var(--text-body);
  color: var(--fg); background: var(--surface);
  border: var(--border-w) solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
input:hover, textarea:hover, select:hover { border-color: var(--fg-faint); }
input:focus-visible, textarea:focus-visible, select:focus-visible { box-shadow: var(--focus-shadow); border-color: var(--focus-ring); }
textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: var(--text-small); color: var(--fg-muted); }

/* ── Job listing ──────────────────────────────────────────── */
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  flex-wrap: wrap;
}
.job-row h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); }
.job-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.tag {
  font-size: var(--text-micro); font-weight: var(--weight-medium);
  color: var(--fg-muted); background: var(--bg-subtle);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--r-sm); padding: 3px 8px;
}
.job-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); }
.job-facts .fact strong { display: block; font-size: var(--text-micro); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-faint); margin-bottom: 2px; }
.job-facts .fact span { font-size: var(--text-small); font-weight: var(--weight-medium); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--inverse-bg); color: var(--inverse-muted); margin-top: var(--sp-20); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-10);
  padding: var(--sp-16) 0 var(--sp-10);
}
.site-footer .brand { color: var(--q-white); }
.site-footer .brand img { height: 30px; }
.footer-tagline { margin-top: var(--sp-4); font-size: var(--text-small); max-width: 30ch; }
.footer-col h4 {
  font-size: var(--text-micro); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--q-gray-400); margin-bottom: var(--sp-4);
  font-weight: var(--weight-semibold);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.footer-col a { color: var(--inverse-muted); font-size: var(--text-small); }
.footer-col a:hover { color: var(--q-white); text-decoration: none; }
.footer-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: var(--border-w) solid var(--q-navy-700); color: var(--inverse-muted);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.footer-social a:hover { border-color: var(--q-gray-400); color: var(--q-white); }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom {
  border-top: var(--border-w) solid var(--q-navy-700);
  padding: var(--sp-5) 0; font-size: var(--text-small); color: var(--q-gray-400);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: var(--sp-8); } }

/* ── Utilities ────────────────────────────────────────────── */
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.center { text-align: center; }

/* ── Split layouts (responsive two-column sections) ───────── */
.split { display: grid; gap: var(--sp-12); align-items: center; }
.split-even { grid-template-columns: 1fr 1fr; }
.split-wide-left { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
.split-wide-right { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
.split .sticky-img { border-radius: var(--r-xl); box-shadow: var(--shadow-md); position: sticky; top: calc(var(--nav-height) + var(--sp-6)); }
@media (max-width: 860px) {
  .split-even, .split-wide-left, .split-wide-right { grid-template-columns: 1fr; }
  .split .sticky-img { position: static; }
}

/* Nav CTA — keep button colors despite .site-nav a rules */
.site-nav a.btn-primary { color: var(--accent-fg); }
.site-nav a.btn-primary:hover { color: var(--accent-fg); }

