/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 1rem;
  line-height: 1.6;
  background-color: #0a0a0a;
  color: #c0c0c0;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #00ff00;
  color: #0a0a0a;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
  font-weight: bold;
}

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

/* Links */
a {
  color: #00ff00;
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
  outline: 2px solid #00ff00;
  outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Layout */
.site-header {
  border-bottom: 1px solid #333;
  padding: 1rem 1.5rem;
  background: #0f0f0f;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.site-title:hover {
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: #888;
}

.site-nav a[aria-current="page"] {
  color: #00ff00;
}

.site-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 200px);
}

.site-footer {
  border-top: 1px solid #333;
  padding: 1.5rem;
  background: #0f0f0f;
  text-align: center;
  font-size: 0.875rem;
  color: #666;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-sep {
  margin: 0 0.5rem;
  color: #444;
}

.contact {
  margin-top: 0.5rem;
}

/* Content sections */
.content {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.125rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

/* Identity section (homepage) */
.identity {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #222;
}

.site-name {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.title {
  color: #666;
  margin-bottom: 1rem;
}

.about-short {
  max-width: 600px;
  color: #aaa;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.social-links a::before {
  content: "[";
  color: #666;
}

.social-links a::after {
  content: "]";
  color: #666;
}

/* Repository cards */
.repositories, .code-listing {
  margin-bottom: 2.5rem;
}

.repo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.repo-item {
  background: #0f0f0f;
  border: 1px solid #222;
  border-left: 3px solid #00ff00;
  padding: 1rem;
}

.repo-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.repo-platform {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repo-platform-github {
  background: #222;
  color: #fff;
}

.repo-platform-sourcehut {
  background: #1a1a2e;
  color: #a0a0ff;
}

.repo-name {
  font-weight: 600;
  color: #fff;
}

.repo-name:hover {
  text-decoration: none;
}

.repo-description {
  margin: 0;
  color: #888;
  font-size: 0.9375rem;
}

/* Post lists */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item time {
  color: #666;
  font-size: 0.875rem;
  white-space: nowrap;
}

.latest-posts .post-item,
.posts-listing .post-item {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.125rem;
}

.post-excerpt {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: #888;
  font-size: 0.9375rem;
}

/* Single post */
.post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #222;
}

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  color: #666;
  font-size: 0.875rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  color: #00ff00;
  font-size: 0.875rem;
}

.tag:hover {
  text-decoration: none;
}

.post-content {
  margin-bottom: 2rem;
}

.post-content a {
  text-decoration: underline;
}

.post-content code {
  background: #1a1a1a;
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  font-size: 0.875rem;
}

.post-content pre {
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid #333;
  margin: 1rem 0;
  padding-left: 1rem;
  color: #888;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

.post-footer {
  padding-top: 1rem;
  border-top: 1px solid #222;
}

/* Listing pages */
.listing-description {
  color: #888;
  margin-bottom: 1.5rem;
}

.tag-cloud {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Utility */
.view-all {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.back-link {
  margin-top: 1.5rem;
  display: block;
}

.no-posts {
  color: #666;
  font-style: italic;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  color: #00ff00;
}

.error-message {
  color: #888;
  margin-bottom: 1.5rem;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid #00ff00;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav ul {
    gap: 1rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .post-item {
    flex-direction: column;
  }

  .post-item time {
    margin-top: 0.25rem;
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  body {
    background: #000;
    color: #fff;
  }

  .repo-item {
    border: 2px solid #fff;
  }

  a {
    color: #00ffff;
  }
}
