/* Base Reset and Typography */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Typography Scale */
h1, .h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h2, .h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h3, .h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h4, .h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

h5, .h5 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-normal);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

h6, .h6 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: var(--leading-normal);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

p {
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.lead {
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--newrons-accent-hover);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

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

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.125em 0.25em;
  border-radius: var(--radius-sm);
  color: var(--newrons-danger);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--newrons-accent);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: var(--space-8) 0;
}

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

::-moz-selection {
  background: var(--newrons-accent);
  color: white;
}

/* Focus Styles */
:focus {
  outline: 2px solid var(--newrons-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

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

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-md);
  border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--bg-secondary);
}