/*
 * Base styles — page-level resets and defaults applied on top of tokens.css.
 * Phase 2 components extend this with their own component-scoped CSS.
 */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0 0 0.5em 0;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); font-weight: var(--weight-medium); line-height: var(--leading-snug); }
h4 { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }

p {
  margin: 0 0 1em 0;
}

a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-thickness: var(--border-thin);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--text-link-hover);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

::selection {
  background: var(--color-kale-200);
  color: var(--text-primary);
}

:focus-visible {
  outline: var(--border-thick) solid var(--border-focus);
  outline-offset: 2px;
}

/* Page shell — used by base layout */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page__main {
  flex: 1;
  padding: var(--space-8) var(--space-6) var(--space-16);
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.muted { color: var(--text-muted); }
.mono  { font-family: var(--font-mono); }

/* Skip-to-content link — keyboard-only a11y per WCAG 2.1 AA. Hidden
   off-screen until focused, then reveals in the top-left. Targets the
   <main id="main"> element added in _base.html. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-kale-700);
  color: var(--text-on-brand);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-3);
  outline: 2px solid var(--color-kale-500);
  outline-offset: 2px;
}
