/*
 * Base layer — element defaults, layout primitives and shared type utilities.
 *
 * @package Slyfox_Digital
 */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sf-white);
  color: var(--sf-ink);
  font-family: var(--sf-font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sf-font-head);
  color: var(--sf-navy);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  text-wrap: pretty;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--sf-navy); }
img, svg, iframe { max-width: 100%; display: block; }
figure { margin: 0; }

/* Focus is never removed — AODA is a product claim for this client. */
:focus-visible {
  outline: 3px solid var(--sf-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
 * Layout primitives
 * ------------------------------------------------------------------------ */
.sf-wrap { max-width: var(--sf-max); margin-inline: auto; padding-inline: var(--sf-gutter); }
.sf-section { padding-block: var(--sf-section-y); }
.sf-section--lg { padding-block: var(--sf-section-y-lg); }
.sf-surface { background: var(--sf-surface); }

/* Navy band with the fox silhouette cropped off-edge. */
.sf-navy { background: var(--sf-navy); color: var(--sf-white); position: relative; overflow: hidden; }
.sf-navy h1, .sf-navy h2, .sf-navy h3, .sf-navy h4 { color: var(--sf-white); }
.sf-fox {
  position: absolute;
  opacity: .08;
  pointer-events: none;
  width: clamp(300px, 40vw, 620px);
  right: -8%;
  bottom: -40%;
}
.sf-fox--hero { width: clamp(360px, 52vw, 860px); right: -4%; top: 50%; bottom: auto; transform: translateY(-46%); opacity: .09; }
.sf-fox--left { left: -8%; right: auto; bottom: -45%; opacity: .06; }
.sf-fox--top { right: -6%; top: -10%; bottom: auto; width: clamp(320px, 44vw, 700px); }

@media (max-width: 768px) {
  .sf-fox--hero { width: 70vw; right: -12%; top: auto; bottom: -6%; transform: none; }
}

/* --------------------------------------------------------------------------
 * Shared type
 * ------------------------------------------------------------------------ */
.sf-eyebrow {
  font-family: var(--sf-font-head);
  font-size: var(--sf-eyebrow);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sf-orange);
  margin: 0 0 16px;
}
.sf-eyebrow--tight { letter-spacing: .1em; margin-bottom: 10px; }

/*
 * Keep the eyebrow orange when it is itself a heading inside a navy band.
 * `.sf-navy h1` (0,1,1) otherwise outranks `.sf-eyebrow` (0,1,0) and paints it
 * white — which is what happens on the homepage, where the eyebrow IS the H1.
 */
.sf-navy .sf-eyebrow { color: var(--sf-orange); }

/*
 * Display headline. Carries its own font stack and weight rather than leaning
 * on the h1 element rule, because on the homepage it sits on a <p>: the H1
 * there is the eyebrow, so this element is presentational display text only.
 * Colour is inherited so it reads white on a navy band and ink on white.
 */
.sf-h1-hero {
  font-family: var(--sf-font-head);
  font-weight: 800;
  color: inherit;
  font-size: var(--sf-h1-hero);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 24px;
  text-wrap: pretty;
}
.sf-h1 { font-size: var(--sf-h1-page); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 20px; }
.sf-h1--sm { font-size: var(--sf-h1-page-sm); line-height: 1.04; }
.sf-h2 { font-size: var(--sf-h2); line-height: 1.1; margin: 0 0 28px; }
.sf-h2--lg { font-size: var(--sf-h2-lg); line-height: 1.08; }
.sf-lead { font-size: 19px; line-height: 1.6; max-width: 64ch; }
.sf-navy .sf-lead { opacity: .92; }

.sf-measure { max-width: 70ch; }

/* Section header with a right-aligned "view all" link. */
.sf-sechead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}
.sf-sechead h2, .sf-sechead h3 { margin: 0; }

/* Arrow text link: navy with an orange rule that turns orange on hover. */
.sf-arrow {
  font-family: var(--sf-font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--sf-navy);
  text-decoration: none;
  border-bottom: 2px solid var(--sf-orange);
  transition: color var(--sf-t);
}
.sf-arrow:hover { color: var(--sf-orange); }

/* Accessible-but-hidden text. */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.screen-reader-text:focus {
  position: static; width: auto; height: auto; margin: 0; clip-path: none;
}

.sf-skip {
  position: absolute; left: 16px; top: -4rem; z-index: 200;
  background: var(--sf-navy); color: var(--sf-white);
  font-family: var(--sf-font-head); font-weight: 700;
  padding: 12px 20px; border-radius: var(--sf-r-btn); text-decoration: none;
  transition: top var(--sf-t);
}
.sf-skip:focus { top: 16px; }
