/* ============================================================================
   QVD design system
   ----------------------------------------------------------------------------
   Global composition and component primitives. Page styles should contain
   only page-specific visuals and arrangements.

   Naming:
   - Base:      .section, .card, .btn
   - Element:   .section__head, .card__meta
   - Modifier:  .section--subtle, .btn--primary
   - Layout:    .stack, .cluster, .grid, .split
   ========================================================================== */

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

.container--narrow { max-width: var(--measure); }
.container--wide { max-width: 90rem; }

.section {
  position: relative;
  padding-block: clamp(var(--space-20), 8vw, var(--space-32));
}

.section--compact,
.section--tight {
  padding-block: clamp(var(--space-16), 6vw, var(--space-24));
}

.section--subtle { background: var(--c-subtle); }

.section--dark,
.section.is-dark {
  color: #b8c5d6;
  background: var(--c-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section.is-dark h1,
.section.is-dark h2,
.section.is-dark h3 { color: #fff; }

.section__head {
  max-width: 47rem;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

/* Two-column head: title left, supporting lede right. Use wherever the grid
   below spans the full container, so the head does not leave the right third
   of the section empty. */
.section__head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  max-width: none;
}

.section__head--split > *:last-child { margin-bottom: 0; }
.section__head--split h2,
.section__head--split h3 { margin-bottom: 0; }

.section__head h2,
.split h2 {
  margin-bottom: var(--space-6);
  font-size: clamp(2.125rem, 4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.038em;
}

.stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stack > * { margin-block: 0; }
.stack > * + * { margin-block-start: var(--stack-space, var(--space-6)); }
.stack--sm { --stack-space: var(--space-3); }
.stack--lg { --stack-space: var(--space-10); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-space, var(--space-3));
}

.cluster--between { justify-content: space-between; }
.cluster--center { justify-content: center; }

.grid {
  display: grid;
  gap: var(--grid-space, var(--space-4));
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.grid--gap-lg { --grid-space: var(--space-8); }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(var(--space-12), 7vw, var(--space-24));
}

.split--center { align-items: center; }
.measure { max-width: var(--measure); }

/* ---- Typography --------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.heading-xl {
  font-size: clamp(2.125rem, 4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.038em;
}

.heading-lg {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.032em;
}

.lede,
.text-lg {
  color: var(--c-muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.7;
}

.is-dark .lede,
.section--dark .lede { color: #a9b8cb; }

.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--c-muted); }
.text-center { text-align: center; }

.eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-5);
  color: var(--c-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.is-dark .eyebrow,
.section--dark .eyebrow { color: #79b8f8; }

/* ---- Actions ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  color: var(--c-primary);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn--primary {
  color: #fff;
  background: var(--c-primary);
}

.btn--primary:hover { background: var(--c-primary-dark); }

.btn--secondary {
  color: var(--c-primary);
  border-color: rgba(0,100,224,0.22);
  background: rgba(0,100,224,0.06);
}

.btn--secondary:hover { background: rgba(0,100,224,0.11); }

.btn--ghost {
  color: var(--c-primary);
  border-color: var(--c-border);
}

.btn--ghost:hover { border-color: var(--c-primary); }

.is-dark .btn--ghost,
.section--dark .btn--ghost,
.cmp-cta-band--dark .btn--ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

.is-dark .btn--ghost:hover,
.section--dark .btn--ghost:hover,
.cmp-cta-band--dark .btn--ghost:hover { border-color: rgba(255,255,255,0.7); }

.btn--sm { min-height: 2.5rem; padding: 0.55rem 1rem; font-size: 0.875rem; }
.btn--block { width: 100%; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-6);
}

/* ---- Surfaces ----------------------------------------------------------- */
.surface {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
}

.surface--subtle { background: var(--c-subtle); }
.surface--padded { padding: var(--space-8); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-4);
}

.card {
  padding: var(--space-8);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

a.card { color: inherit; text-decoration: none; }

.card:hover {
  transform: translateY(-2px);
  border-color: #bed6ef;
  box-shadow: 0 1rem 2.5rem rgba(18,53,91,0.08);
}

.card h3 { margin-bottom: var(--space-4); }
.card p { margin-bottom: var(--space-4); color: var(--c-muted); }

.card__meta {
  display: block;
  margin-bottom: var(--space-4);
  color: var(--c-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.card__link {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.card--featured { grid-column: 1 / -1; }
.card--static:hover { transform: none; border-color: var(--c-border); box-shadow: none; }

/* Inverted card. Promotes one item in a light grid without pulling it out of
   the grid's column rhythm. */
.card--dark {
  color: #b8c8da;
  border-color: #173f68;
  background: #0a1d32;
}

.card--dark h3 { color: #fff; }
.card--dark p,
.card--dark .card__meta { color: #b8c8da; }
.card--dark .card__link { color: #7dbdff; }
.card--dark:hover { border-color: #2c6099; box-shadow: 0 1rem 2.5rem rgba(6,22,41,0.35); }

/* ---- Latest news --------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

/* Media sits on top at the card's full width. Post artwork is usually a wide
   banner with text baked in, so a narrow side crop cut it mid-word. */
.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: #bed6ef;
  box-shadow: 0 1rem 2.5rem rgba(18,53,91,0.08);
}

.news-card__media {
  flex: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-subtle);
}

.news-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--space-6);
}

.news-card__title {
  margin: 0 0 var(--space-3);
  color: var(--c-ink);
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.news-card__desc {
  flex: 1;
  margin: 0 0 var(--space-4);
  color: var(--c-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.news-card__link {
  color: var(--c-primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-4);
}

/* Single column, for a stat stack beside body copy. auto-fit would give an odd
   count a half-empty final row inside the rail's border. */
.stat-grid--rail { grid-template-columns: 1fr; }

.stat {
  padding: var(--space-8);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
}

.stat .num,
.stat__value {
  display: block;
  color: var(--c-primary);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.stat p,
.stat__label { margin: var(--space-3) 0 0; }

.is-dark .stat,
.section--dark .stat {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.035);
}

.is-dark .stat .num,
.is-dark .stat__value,
.section--dark .stat .num,
.section--dark .stat__value { color: #78baff; }

.quote {
  margin: 0;
  padding: var(--space-8);
  color: var(--c-ink);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  font-size: clamp(1.0625rem, 1.7vw, 1.25rem);
  font-style: normal;
  line-height: 1.75;
}

.is-dark .quote,
.section--dark .quote {
  color: #edf4fb;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.quote cite {
  display: block;
  margin-top: var(--space-6);
  color: #91a5bc;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 700;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.5rem var(--space-4);
  color: #344256;
  border: 1px solid #dce5ef;
  border-radius: 999px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.bullets {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-8);
  padding: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  padding-left: var(--space-8);
}

.bullets li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--c-primary);
  font-weight: 800;
}

/* A single figure called out inside running copy, where a full .stat card would
   be too much furniture. */
.inline-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin: 0 0 var(--space-8);
  padding-left: var(--space-5);
  border-left: 3px solid var(--c-primary);
}

.inline-stat strong {
  flex: none;
  color: var(--c-primary);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.inline-stat span {
  color: var(--c-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---- Forms -------------------------------------------------------------- */
.form { max-width: 38rem; }

.field {
  display: grid;
  gap: var(--space-2);
}

.field > label,
.field__label {
  color: var(--c-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem var(--space-4);
  color: var(--c-body);
  border: 1px solid #cbd6e2;
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  letter-spacing: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea.input { min-height: 8rem; resize: vertical; }

.input:hover { border-color: #9eb1c5; }

.input:focus {
  border-color: var(--c-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0,100,224,0.12);
}

.field__help {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.8125rem;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---- Utilities ---------------------------------------------------------- */
/* The browser's own [hidden] rule is `display: none` at the weakest possible
   specificity, so any class that sets `display` beats it and el.hidden = true
   does nothing visible. Every JS-toggled panel on this site relies on that
   attribute, so it wins here. */
[hidden] { display: none !important; }

.m-0 { margin: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mt-12 { margin-top: var(--space-12) !important; }
.mb-0 { margin-bottom: 0 !important; }

.cta-band { text-align: center; }
.cta-band .container { max-width: 46rem; }
.cta-band .cta-row { justify-content: center; }
.cta-band .contact-line { margin-top: var(--space-8); font-size: 0.875rem; font-weight: 700; }
.cta-band .contact-line a { color: #fff; }

@media (max-width: 56rem) {
  .grid--2,
  .grid--3,
  .grid--4,
  .split { grid-template-columns: 1fr; }

  .news-grid { grid-template-columns: 1fr; }

  .section__head--split {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .section__head--split h2,
  .section__head--split h3 { margin-bottom: var(--space-4); }
}

@media (max-width: 36rem) {
  .section { padding-block: var(--space-16); }
  .card,
  .quote,
  .surface--padded { padding: var(--space-6); }
  .cta-row { display: grid; }
  .cta-row .btn { width: 100%; }
  .form__actions .btn { width: 100%; }

  .news-card__media { aspect-ratio: 16 / 10; }

  .inline-stat {
    flex-direction: column;
    gap: var(--space-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
