/* ============================================================
   THE WALLFACER PROJECT
   ============================================================ */

:root {
  --bg:            #07090f;
  --bg-elevated:   #0d1117;
  --bg-surface:    #161b22;
  --border:        #21262d;
  --text:          #e6edf3;
  --text-muted:    #8b949e;
  --accent:        #4f9eed;
  --accent-glow:   rgba(79, 158, 237, 0.12);
  --accent-dim:    #1f6feb;
  --max-width:     900px;
  --reading-width: 700px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 0.125rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-surface);
}

.main-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ============================================================
   MAIN
   ============================================================ */

main.container {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

/* ============================================================
   HOMEPAGE
   ============================================================ */

.homepage-header {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.homepage-header h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.035em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.homepage-header .tagline {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin: 0;
  max-width: 500px;
}

/* ============================================================
   FEATURED GRID
   ============================================================ */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 3rem;
}

.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  text-decoration: none;
  transition: background 0.15s;
}

.featured-card:hover {
  background: var(--bg-surface);
  text-decoration: none;
}

.featured-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface);
}

.featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-card-image img {
  transform: scale(1.04);
}

.featured-card-body {
  padding: 1rem 1.125rem 1.25rem;
  flex: 1;
}

.featured-card-body h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.featured-card-body p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.homepage-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: var(--reading-width);
}

.homepage-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2.25em;
  margin-bottom: 0.75em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}

.homepage-content p {
  margin: 0 0 1.1em;
  color: var(--text-muted);
}

.homepage-content p strong a,
.homepage-content p a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.homepage-content p strong a:hover,
.homepage-content p a:hover {
  color: var(--accent);
}

.homepage-content ul,
.homepage-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25em;
  color: var(--text-muted);
}

.homepage-content li {
  margin-bottom: 0.4em;
}

.homepage-content li a {
  color: var(--text);
  text-decoration: none;
}

.homepage-content li a:hover {
  color: var(--accent);
}

.homepage-content li strong {
  color: var(--text);
}

.homepage-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.homepage-content em {
  color: var(--text-muted);
}

.recent-articles h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

/* ============================================================
   ARTICLE CARDS
   ============================================================ */

.article-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.article-card {
  background: var(--bg-elevated);
  padding: 1.125rem 1.375rem;
  transition: background 0.15s;
}

.article-card:hover {
  background: var(--bg-surface);
}

.article-card h2,
.article-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.article-card h2 a,
.article-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.article-card h2 a:hover,
.article-card h3 a:hover {
  color: var(--accent);
}

.article-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   SECTION PAGE
   ============================================================ */

.section-page .section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.section-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-description {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

.section-intro {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.75rem;
}

.section-intro p { margin: 0 0 0.5em; }
.section-intro ul { padding-left: 1.5rem; margin: 0 0 0.75em; }
.section-intro li { margin-bottom: 0.25em; }

/* ============================================================
   ARTICLE
   ============================================================ */

.article {
  max-width: var(--reading-width);
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.article-description {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.6;
}

.article-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-image {
  width: 100%;
  border-radius: 8px;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
}

/* Prose */

.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  letter-spacing: -0.01em;
  margin-top: 2.25em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.article-content h2 {
  font-size: 1.375rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  font-size: 1.125rem;
}

.article-content p {
  margin: 0 0 1.25em;
}

.article-content strong {
  color: var(--text);
  font-weight: 600;
}

.article-content em {
  color: #b3c9e8;
}

.article-content a {
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
}

.article-content a:hover {
  text-decoration-color: var(--accent);
}

.article-content blockquote {
  border-left: 3px solid var(--accent-dim);
  margin: 1.75em 0;
  padding: 0.75em 1.25em;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-elevated);
  border-radius: 0 6px 6px 0;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25em;
}

.article-content li {
  margin-bottom: 0.4em;
}

.article-content code {
  font-family: 'SF Mono', Consolas, 'Cascadia Code', monospace;
  font-size: 0.875em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #d2a679;
}

.article-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Tags */

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

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

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(79, 158, 237, 0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  letter-spacing: 0.01em;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .homepage-header h1 {
    font-size: 1.875rem;
  }

  .article-header h1 {
    font-size: 1.625rem;
  }

  .article-content {
    font-size: 1rem;
  }
}
