/* System Sans-Serif Stack */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1a1a1a;
  --bg-elevated: #242424;
  --text-primary: #c8c8c8;
  --text-secondary: #808080;
  --text-muted: #5a5a5a;
  --border: #333;
  --accent: #888;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* Header */
header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1rem;
}

.date {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: 'iA Writer Mono', monospace;
}

/* Download Button */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.download-btn:hover {
  background: var(--border);
  color: var(--text-primary);
  border-color: var(--accent);
}

.download-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Typography */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

strong {
  font-weight: 700;
  color: var(--text-primary);
}

em {
  font-style: italic;
}

/* Links */
a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-primary);
}

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

li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

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

/* Code */
code {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  color: var(--text-secondary);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

/* Blockquote */
blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Abstract */
.abstract {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Section styling for architecture diagram */
.architecture-diagram {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'iA Writer Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: pre;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 2rem 1.25rem 4rem;
  }
  
  .title {
    font-size: 1.75rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  h2 {
    font-size: 1.25rem;
    margin-top: 2.5rem;
  }
  
  pre {
    font-size: 0.75rem;
    padding: 1rem;
  }
  
  table {
    font-size: 0.8125rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

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