/* ==========================================================================
   Refine Direct — Color & Type tokens
   Pair with: <link rel="stylesheet" href="colors_and_type.css">
   Body font is Manrope (Google Fonts) — see fonts/ and README Caveats.
   ========================================================================== */

/* Barlow loaded via Google Fonts CDN (see index.html). */

:root {
  /* ---------- Brand color ---------- */
  --rd-black:       #000000;
  --rd-white:       #FFFFFF;
  --rd-red:         #FF0000;   /* siren red — accent only, never a fill */
  --rd-gray:        #F2F2F2;   /* light gray — soft neutral surface */

  /* ---------- Neutrals (black @ % on white) ---------- */
  --rd-ink-04:      rgba(0,0,0,0.04);   /* surface tint, hover bg */
  --rd-ink-08:      rgba(0,0,0,0.08);   /* hairline */
  --rd-ink-16:      rgba(0,0,0,0.16);   /* light divider */
  --rd-ink-32:      rgba(0,0,0,0.32);   /* disabled fg */
  --rd-ink-56:      rgba(0,0,0,0.56);   /* secondary fg */
  --rd-ink-72:      rgba(0,0,0,0.72);   /* tertiary heading on white */

  /* ---------- Semantic surface ---------- */
  --bg:             var(--rd-white);
  --bg-elevated:    var(--rd-white);
  --bg-inverse:     var(--rd-black);
  --bg-tint:        var(--rd-ink-04);

  /* ---------- Semantic foreground ---------- */
  --fg1:            var(--rd-black);     /* primary text */
  --fg2:            var(--rd-ink-72);    /* secondary text */
  --fg3:            var(--rd-ink-56);    /* tertiary / captions */
  --fg-muted:       var(--rd-ink-32);    /* disabled */
  --fg-on-inverse:  var(--rd-white);
  --fg-accent:      var(--rd-red);

  /* ---------- Borders ---------- */
  --border:         var(--rd-ink-16);
  --border-strong:  var(--rd-black);
  --border-focus:   var(--rd-red);

  /* ---------- Status (kept achromatic-ish, brand has no green/blue palette) ---------- */
  --status-info:    var(--rd-black);
  --status-success: #0E8345;
  --status-warning: #B8770F;
  --status-error:   var(--rd-red);

  /* ---------- Spacing scale (px) ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* ---------- Radii ---------- */
  --radius-0: 0px;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-pill: 999px;   /* used only for the brand mark / R icon */

  /* ---------- Shadows ---------- */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-2: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  --shadow-focus: 0 0 0 2px var(--rd-white), 0 0 0 4px var(--rd-red);

  /* ---------- Motion ---------- */
  --ease-snap: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;

  /* ---------- Type families ---------- */
  --font-display: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:    "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Roboto Mono", ui-monospace, monospace;

  /* ---------- Type scale (px) ---------- */
  --fs-display-xl: 96px;   /* hero — single-line headline */
  --fs-display-l:  72px;
  --fs-display-m:  56px;
  --fs-h1:         44px;
  --fs-h2:         32px;
  --fs-h3:         24px;
  --fs-h4:         20px;
  --fs-body-lg:    18px;
  --fs-body:       16px;
  --fs-body-sm:    14px;
  --fs-caption:    12px;
  --fs-overline:   11px;

  /* ---------- Type weight ---------- */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-extrablack:800;
  --fw-black:   900; /* Barlow Black — matches the wordmark weight */

  /* ---------- Tracking & leading ---------- */
  --lh-tight:    1.04;
  --lh-snug:     1.15;
  --lh-normal:   1.45;
  --lh-loose:    1.6;

  --tr-display: -0.02em;
  --tr-tight:   -0.01em;
  --tr-normal:  0em;
  --tr-overline: 0.08em;
}

/* ==========================================================================
   Semantic element styles — apply by default to plain HTML
   ========================================================================== */

html, body {
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  color: var(--fg1);
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  color: var(--fg1);
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  margin: 0 0 var(--sp-3);
}

h4, .h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
  margin: 0 0 var(--sp-2);
}

.display-xl {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-display-xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}
.display-l {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-display-l);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}
.display-m {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: var(--fs-display-m);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}

p, .body {
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg1);
  margin: 0 0 var(--sp-3);
  text-wrap: pretty;
}
.body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-normal); }
.body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-normal); color: var(--fg2); }

.caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-normal);
  color: var(--fg3);
}

.overline {
  font-size: var(--fs-overline);
  letter-spacing: var(--tr-overline);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--fg2);
}

a {
  color: var(--fg1);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  transition: opacity var(--dur-fast) var(--ease-snap);
}
a:hover { opacity: 0.7; }
a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-bottom-color: transparent;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--bg-tint);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-1);
}

hr {
  border: 0;
  border-top: 1px solid var(--border-strong);
  margin: var(--sp-8) 0;
}

::selection {
  background: var(--rd-red);
  color: var(--rd-white);
}

/* ==========================================================================
   Shared footer
   ========================================================================== */

.site-footer {
  background: #000;
  color: rgba(255,255,255,0.72);
  padding: 42px 40px 34px;
}

.site-footer .footer-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.site-footer .footer-main {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.1fr) minmax(260px, 1.15fr) minmax(190px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.site-footer .footer-logo {
  display: inline-flex;
  border-bottom: 0;
}

.site-footer .footer-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.site-footer .footer-block {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
}

.site-footer .footer-address {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer .pin {
  width: 9px;
  height: 9px;
  background: var(--rd-red);
  flex: none;
}

.site-footer .footer-partners {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-footer .partner-label {
  color: rgba(255,255,255,0.58);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-footer .logo-iab {
  height: 34px;
  width: auto;
}

.site-footer .logo-google-partner {
  height: 38px;
  width: auto;
}

.site-footer .footer-links {
  display: flex;
  justify-content: flex-end;
}

.site-footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

.site-footer a {
  border-bottom: 0;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  opacity: 1;
}

.site-footer .footer-links a {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 28px 0 20px;
}

.site-footer .footer-legal {
  margin: 0;
  color: rgba(255,255,255,0.56);
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 980px) {
  .site-footer .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .footer-links {
    justify-content: flex-start;
  }

  .site-footer .footer-links ul {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .site-footer {
    padding: 34px 22px 30px;
  }

  .site-footer .footer-main {
    grid-template-columns: 1fr;
    gap: 22px;
    text-align: center;
  }

  .site-footer .footer-logo,
  .site-footer .footer-address,
  .site-footer .footer-partners,
  .site-footer .footer-links,
  .site-footer .footer-links ul {
    justify-content: center;
  }
}
