* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
}

body::selection {
  background: var(--accent);
  color: var(--ink-inverse, #f0f1f7);
}

html.dark body::selection {
  background: var(--accent-light);
  color: var(--ink-inverse);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Prose content links: always underlined to match Astro/Tailwind typography */
.prose a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-header);
  font-weight: 700;
  line-height: 1.2;
  scroll-margin-top: 7rem;
}

b,
strong {
  font-weight: 700;
}

/* Enhanced focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html.dark a:focus-visible,
html.dark button:focus-visible,
html.dark input:focus-visible,
html.dark textarea:focus-visible,
html.dark select:focus-visible {
  outline-color: var(--accent-light);
}

img {
  max-width: 100%;
  border-radius: var(--radius);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.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;
}

.is-hidden {
  display: none !important;
}

/* Fluid typography utilities */
.text-fluid-base {
  font-size: clamp(1rem, 0.8vw + 0.9rem, 1.125rem);
}

.text-fluid-lg {
  font-size: clamp(1.125rem, 1vw + 1rem, 1.25rem);
}

.text-fluid-xl {
  font-size: clamp(1.25rem, 1.5vw + 1rem, 1.5rem);
}

.text-fluid-2xl {
  font-size: clamp(1.5rem, 2vw + 1rem, 1.75rem);
}

.text-fluid-3xl {
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2rem);
}

.text-fluid-4xl {
  font-size: clamp(2rem, 3vw + 1rem, 2.5rem);
}

.text-fluid-5xl {
  font-size: clamp(2.5rem, 4vw + 1rem, 3rem);
}

.text-fluid-6xl {
  font-size: clamp(3rem, 5vw + 1rem, 4rem);
}
