/* ==========================================================================
   global.css — Novabridge 2026
   Reset, typography scale, layout utilities, background helpers, a11y
   Depends on: tokens.css (must be loaded first)
   ========================================================================== */


/* ==========================================================================
   1. MODERN CSS RESET
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text-body);
  background-color: var(--color-white);
}

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

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

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* ==========================================================================
   2. TYPOGRAPHY SCALE — mobile-first, desktop overrides at 1280px
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-black);
  text-wrap: balance;
}

/* --- h1 ----------------------------------------------------------------- */
h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

/* --- h2 ----------------------------------------------------------------- */
h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

/* --- h3 ----------------------------------------------------------------- */
h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

/* --- h4 ----------------------------------------------------------------- */
h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

/* --- h5, h6 ------------------------------------------------------------- */
h5,
h6 {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

/* --- Desktop type scale (≥ 1280px) -------------------------------------- */
@media (min-width: 1280px) {
  h1 {
    font-size: var(--fs-7xl);
  }

  h2 {
    font-size: var(--fs-5xl);
  }

  h3 {
    font-size: var(--fs-3xl);
  }
}

/* --- Body copy ---------------------------------------------------------- */
p {
  margin-bottom: var(--sp-4);
  max-width: 65ch;
}

strong {
  font-weight: var(--fw-bold);
}

/* --- Eyebrow label ------------------------------------------------------ */
.eyebrow {
  font-size: calc(var(--fs-sm) * 1.3);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-accent);
}

/* On pale/light backgrounds, teal accent lacks contrast — use primary purple instead */
.bg-light .eyebrow {
  color: var(--color-primary);
}

/* On purple hero backgrounds, use near-white for eyebrow legibility */
.bg-primary .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}


/* ==========================================================================
   3. LAYOUT UTILITIES
   ========================================================================== */

/* --- Containers --------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--wide {
  max-width: var(--container-wide);
}

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

/* --- Sections ----------------------------------------------------------- */
.section {
  padding-block: var(--section-pad-y);
}

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

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

/* --- Grid: 2 columns ---------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Grid: 3 columns ---------------------------------------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1280px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Modifier: centre a partial set of cards in a 3-column grid. Used for
   sections that currently have 2 cards but may grow back to 3 — keeps
   the layout balanced rather than left-aligned with empty space on the
   right. Remove when the third card returns. */
.grid-3--centered {
  max-width: 880px;
  margin-inline: auto;
}

@media (min-width: 1280px) {
  .grid-3--centered {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Grid: 4 columns ---------------------------------------------------- */
.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 768px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1280px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}


/* ==========================================================================
   4. BACKGROUND COLOUR UTILITIES
   ========================================================================== */

.bg-white {
  background-color: var(--color-white);
}

.bg-light {
  background-color: var(--color-surface-light);
}

.bg-primary {
  background-color: var(--color-primary);
  color: var(--color-text-on-dark);
}

.bg-dark {
  background-color: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}

.bg-teal-3 {
  background-color: var(--color-teal-3);
  color: var(--color-white);
}

.bg-blue-3 {
  background-color: var(--color-blue-3);
  color: var(--color-white);
}

/* Headings inside dark/coloured backgrounds inherit text colour */
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6 {
  color: var(--color-text-on-dark);
}

/* Muted text on dark backgrounds */
.bg-primary .text-muted,
.bg-dark .text-muted {
  color: var(--color-purple-1);
}


/* ==========================================================================
   5. ACCESSIBILITY
   ========================================================================== */

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus-visible ring */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  z-index: 9999;
}

.skip-link:focus {
  top: var(--sp-4);
  text-decoration: none;
}
