/* Field note shared template styles.
   Used by every page in site/field-notes/. Covers the nav, article
   shell (eyebrow/h1/dek/meta/body/pull-quote/figure/sources/close),
   footer, and skip-link. Every diagram is its own inline SVG inside
   .article__figure, shaped by what that post is actually arguing --
   nested rings, a pipeline, an equation, a fork -- not one reused
   box-chain component. Keep it that way: a new diagram type belongs
   in the post's own extra_css only if genuinely one-off; promote it
   here only if two or more posts end up needing the identical thing. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-hero);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: var(--leading-normal);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-primary);
  color: var(--text-on-accent-signal);
  padding: var(--space-3) var(--space-5);
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 var(--space-7);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-bottom: var(--border-width-hairline) solid var(--nav-border);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  color: var(--text-primary);
  text-decoration: none;
  text-shadow: 0 0 0 transparent;
  transition: text-shadow var(--duration-base) var(--ease-standard);
}

.nav__brand:hover, .nav__brand:focus-visible {
  text-shadow: 0 0 14px var(--color-trace-glow);
}

.nav__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-trace-base);
  box-shadow: 0 0 0 3px var(--bg-accent-soft-trace);
  animation: pulse-glow var(--duration-glow-pulse) var(--ease-standard) infinite;
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.nav__links a {
  color: var(--text-secondary);
  text-decoration: none;
  text-shadow: 0 0 0 transparent;
  transition: var(--transition-color), text-shadow var(--duration-base) var(--ease-standard);
}

.nav__links a:hover, .nav__links a:focus-visible {
  color: var(--text-primary);
  text-shadow: 0 0 14px var(--color-trace-glow);
}

@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
}

.article {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--space-11) var(--space-7) var(--space-13);
}

.article__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  margin: 0 0 var(--space-9);
  transition: var(--transition-color);
}

.article__back:hover, .article__back:focus-visible {
  color: var(--color-signal-text);
}

.article__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-signal-text);
  margin: 0 0 var(--space-4);
}

.article h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-primary);
  text-wrap: balance;
  margin: 0 0 var(--space-4);
}

@media (min-width: 640px) {
  .article h1 {
    font-size: var(--text-3xl);
  }
}

.article__dek {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  max-width: 38ch;
  margin: 0 0 var(--space-6);
}

.article__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-10);
}

.article__body p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin: 0 0 0.95em;
}

.article__body h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin: var(--space-9) 0 var(--space-3);
}

.article__body h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  color: var(--text-primary);
  margin: var(--space-6) 0 var(--space-2);
}

.article__body ul {
  margin: 0 0 1.1em 1.25em;
  padding: 0;
}

.article__body li {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin-bottom: 0.4em;
}

.article__pull {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--text-primary);
  margin: var(--space-8) 0;
  padding-left: var(--space-5);
  border-left: 2px solid var(--border-accent-signal);
}

.article__figure {
  margin: var(--space-7) 0 var(--space-8);
}

.article__figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.article__figure figcaption {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  line-height: var(--leading-relaxed);
  color: var(--text-tertiary);
  text-align: left;
  max-width: 46ch;
  margin: var(--space-4) 0 0;
}

.article__related {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: center;
  color: var(--text-tertiary);
  margin: var(--space-10) 0 0;
}

.article__related a {
  color: var(--color-signal-text);
  text-decoration: none;
}

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

.article__sources {
  margin-top: var(--space-9);
  padding-top: var(--space-7);
  border-top: var(--border-width-hairline) solid var(--border-hairline);
}

.article__sources h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 var(--space-4);
}

.article__sources ol {
  margin: 0;
  padding-left: 1.1em;
}

.article__sources li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.article__sources a {
  color: var(--color-signal-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.article__sources a:hover {
  border-bottom-color: currentColor;
}

.article__close {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  text-align: center;
  margin: var(--space-11) 0 0;
  text-wrap: balance;
}

footer.site-footer {
  border-top: var(--border-width-hairline) solid var(--border-hairline);
  padding: var(--space-8) var(--space-7);
  text-align: center;
}

footer.site-footer a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-decoration: none;
}

footer.site-footer a:hover {
  color: var(--color-signal-text);
}

footer.site-footer .copyright {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
