/**
 * base.css — Modern CSS Reset, Typography & Foundational Defaults
 */

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

html {
  font-size: 16px;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--color-bg);
}

/* Typographic Hierarchy — British Editorial Precision */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-family: var(--font-heading, var(--font-sans));
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tighter);
  margin-bottom: var(--space-md);
}

h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2xs);
}

h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2xs);
}

p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

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

strong, b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

small {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Link Styles */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Media Elements */
img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Code & Pre */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

code {
  padding: 0.15em 0.35em;
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  color: var(--color-primary);
}

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

/* Typography & Text Utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

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

.font-normal { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.underline-hover {
  text-decoration: none;
  transition: text-decoration var(--transition-fast);
}
.underline-hover:hover {
  text-decoration: underline;
}

