/* ==========================================================================
   Base Styles — Typography, Links, Editorial Foundation
   ========================================================================== */

/* Google Fonts: Newsreader (editorial serif) + Hanken Grotesk (clean sans) */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,300;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@300;400;500;600&display=swap');

/* Body */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Accent bar at the very top of the page */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: calc(var(--z-nav) + 1);
  transition: background var(--transition-theme);
}

/* Headings — editorial serif */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-6xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 500;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 500;
}

h5 {
  font-size: var(--text-base);
  font-weight: 500;
}

h6 {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Paragraphs */
p {
  margin-bottom: var(--space-md);
  max-width: 60ch;
}

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

/* Links — accent-colored underlines */
a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  transition:
    color var(--transition-fast),
    text-decoration-color var(--transition-fast);
}

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

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

/* Strong and emphasis */
strong,
b {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}

/* Small text */
small {
  font-size: var(--text-sm);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--color-bg-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* Horizontal rules */
hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-xl) 0;
}

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

/* Focus styles */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-modal);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}
