/*
  Base Styles
  Foundation styles, typography, dark mode transitions
*/

html {
  scroll-behavior: smooth;
}

body {
  position: relative; /* For absolute positioned canvas background */
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 300ms ease, color 300ms ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Help user agents render form controls appropriately in both themes */
:root {
  color-scheme: light dark;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.skip-link:focus {
  opacity: 1;
  transform: translateY(0);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-light);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--size-hero);
}

h2 {
  font-size: var(--size-subheading);
}

p {
  font-size: var(--size-body);
  line-height: var(--line-height-normal);
}

small {
  font-size: var(--size-small);
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--duration-fast) ease;
}

a:hover,
a:focus {
  opacity: 0.7;
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Selection */
::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}
