/* Global styles - CSS reset and typography */
@import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* NeueMachina - Display font for headings */
@font-face {
  font-family: 'NeueMachina';
  src: url('/NeueMachina-PlainRegular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.125rem;
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'NeueMachina', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-high);
  margin-bottom: 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.875rem;
  margin-top: 2em;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5em;
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.25em;
}

p {
  margin-bottom: 1.5em;
  color: var(--text);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Lists */
ul, ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

li::marker {
  color: var(--text-low);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--brand);
  padding-left: 1.5em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-medium);
}

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

/* Inline code */
code:not(pre code) {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background-color: var(--bg-sunken);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--text-high);
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* Tables */
table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

thead {
  background-color: var(--bg-sunken);
}

th {
  font-family: 'NeueMachina', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-medium);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

tbody tr:hover {
  background-color: var(--bg-sunken);
}

/* Responsive table wrapper */
@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Strong and emphasis */
strong {
  font-weight: 700;
  color: var(--text-high);
}

em {
  font-style: italic;
}

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

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--text-low);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-medium);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Utility classes */
.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;
}
