@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import './tokens.css';

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-ocean);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition-fast);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-sm); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-navy);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5, h6 { font-size: var(--text-base); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--color-navy); }
em { font-style: italic; }

/* ── Links ── */
a {
  color: var(--color-ocean);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-tangerine);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--color-ocean);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Lists ── */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li { margin-bottom: var(--space-xs); }

ul li::marker { color: var(--color-ocean); }
ol li::marker { color: var(--color-ocean); font-weight: 600; }

/* ── Blockquote ── */
blockquote {
  border-left: 4px solid var(--color-ocean);
  padding: var(--space-sm) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--color-code-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-muted);
  font-style: italic;
}

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

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

/* ── Inline code ── */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  color: var(--color-navy);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ── Page wrapper ── */
.page-wrapper {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (min-width: 768px) {
  .page-wrapper { padding: 0 var(--space-2xl); }
}

@media (min-width: 1400px) {
  .page-wrapper { padding: 0 var(--space-3xl); }
}

/* ── Anchor offset for sticky header ── */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

/* ── 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: 0;
}

.text-muted { color: var(--color-muted); }
.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
