/* ---------------------------------------------------------------------------
 * base.css — reset + base element styling for HL Digital.
 *
 * Loads AFTER tokens/*.css. Every value here references a design token; there
 * are no literal colours, sizes or spacings. The previous site failed by
 * carrying ~1,725 inline styles with no token layer — that is the mistake this
 * file exists to prevent. If a value is missing, add a token, do not hardcode.
 * ------------------------------------------------------------------------- */

/* ---- accent palette override (client correction, 6 Aug 2026) ----
   The brand accent moved from purple/magenta to blue/cyan. base.css loads after
   tokens/colors.css, so these :root values win without editing the token file.
   The companion tokens move with the gradient so nothing clashes: the old
   --accent-purple / --accent-magenta / --accent-pink literals and the purple
   --focus-ring were chosen to match the purple gradient only. Token names are
   kept so every existing rule keeps working. */
:root {
  --gradient-accent: linear-gradient(120deg, #2563EB 0%, #0EA5E9 55%, #06B6D4 100%);
  --accent-purple: #3B82F6;
  --accent-magenta: #0EA5E9;
  --accent-pink: #22D3EE;
  --focus-ring: 0 0 0 3px rgba(14, 165, 233, .36);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The page body grows so the footer always sits at the bottom, even on a short
   page (an error page, an empty order list). */
main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
}

h1 { font-size: clamp(32px, 6vw, var(--h1-size)); line-height: var(--h1-lh); font-weight: var(--h1-weight); letter-spacing: var(--h1-tracking); }
h2 { font-size: clamp(26px, 4vw, var(--h2-size)); line-height: var(--h2-lh); font-weight: var(--h2-weight); letter-spacing: var(--h2-tracking); }
h3 { font-size: clamp(20px, 3vw, var(--h3-size)); line-height: var(--h3-lh); font-weight: var(--h3-weight); letter-spacing: var(--h3-tracking); }
h4 { font-size: var(--body-lg-size); line-height: var(--body-lg-lh); font-weight: var(--body-lg-weight); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-pink); }

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

hr {
  border: 0;
  border-top: 1px solid var(--border-hairline);
  margin: var(--space-7) 0;
}

small { font-size: var(--body-sm-size); line-height: var(--body-sm-lh); }

/* ---- forms: inherit the type system rather than the browser's ---- */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ---- focus: one visible ring everywhere, from the token ---- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Skip link — hidden until focused. Keyboard users can jump the nav. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-3);
  z-index: 100;
  background: var(--surface-3);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
}
.skip-link:focus {
  left: var(--space-4);
}

/* ---- layout primitives ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-8));
}
.container--narrow { max-width: 820px; }
.container--form   { max-width: 560px; }

.section { padding-block: clamp(var(--space-9), 8vw, var(--space-10)); }
.section--tight { padding-block: clamp(var(--space-8), 6vw, var(--space-9)); }
.section--alt {
  background: var(--surface-1);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

/* ---- shared text treatments ---- */
.eyebrow {
  font-family: var(--font-display);
  font-size: var(--label-size);
  line-height: var(--label-lh);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.lede {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  font-weight: 300;
  color: var(--text-secondary);
}

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

/* Gradient text — used on hero headlines and step numerals. */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- surfaces ---- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--elev-1), var(--elev-1-highlight);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--body-sm-size);
  font-weight: 600;
  line-height: 1;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s ease, transform .1s ease, border-color .15s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--gradient-accent);
  color: #fff;
  border: none;
}
.btn--primary:hover { filter: brightness(1.08); color: #fff; }

.btn--secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-hairline);
}
.btn--secondary:hover { border-color: var(--border-hairline-hover); color: var(--text-primary); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn--ghost:hover { color: var(--text-primary); }

.btn--lg { font-size: var(--body-size); padding: var(--space-4) var(--space-7); }
.btn--sm { font-size: var(--body-sm-size); padding: var(--space-2) var(--space-4); }
.btn--block { width: 100%; }

/* ---- tables: never push the page sideways on a phone ---- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- respect reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
