/* research.jkca.me - Canonical Note Styling */

:root {
  /* Colors - Light Mode */
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
  --accent: #0066cc;
  --code-bg: #f5f5f5;
  --section-bg: #fafafa;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Layout */
  --max-width: 680px;
  --border-radius: 4px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --text: #e8e8e8;
    --text-muted: #a0a0a0;
    --border: #2a2a2a;
    --accent: #4da3ff;
    --code-bg: #1a1a1a;
    --section-bg: #141414;
  }
}

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

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  padding: var(--space-lg) var(--space-md);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

a:hover {
  border-bottom-color: var(--accent);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: var(--border-radius);
}

/* Canonical Note Sections */
section {
  margin-bottom: var(--space-xl);
}

.summary {
  background: var(--section-bg);
  border-left: 4px solid var(--accent);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-xl);
}

.summary h1 {
  margin-bottom: var(--space-md);
}

.summary p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

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

/* Section Headers */
section h2::before {
  content: "§ ";
  color: var(--text-muted);
  font-weight: 400;
}

/* Checklist */
.checklist ul {
  list-style: none;
  margin-left: 0;
}

.checklist li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Glossary */
.glossary dl {
  border-left: 2px solid var(--border);
  padding-left: var(--space-md);
}

.glossary dt {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.glossary dt:first-child {
  margin-top: 0;
}

.glossary dd {
  color: var(--text-muted);
  margin-left: 0;
  line-height: 1.6;
}

/* Navigation */
nav {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav a:hover {
  color: var(--accent);
}

/* Index Page */
.note-list {
  list-style: none;
}

.note-item {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--section-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.note-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.note-item h2 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.note-item h2 a {
  color: var(--text);
  border: none;
}

.note-item h2 a:hover {
  color: var(--accent);
}

.note-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.note-summary p {
  margin-bottom: var(--space-xs);
}

/* Footer */
footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  body {
    padding: var(--space-md) var(--space-sm);
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.35rem;
  }
  
  .summary {
    padding: var(--space-md);
  }
  
  .note-item {
    padding: var(--space-md);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  a,
  .note-item {
    transition: none;
  }
  
  .note-item:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
    padding: 0;
  }
  
  nav,
  footer {
    display: none;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .summary {
    background: transparent;
    border-left-color: black;
  }
}
