*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f7f5f2;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #0d6e6e;
  --accent-soft: #e6f3f3;
  --border: #e0dcd6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(720px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  padding: 1.75rem 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filters {
  padding: 1.25rem 0 0.5rem;
}

.subject-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: var(--accent);
}

.chip-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.articles {
  padding: 0.75rem 0 2rem;
}

.article-list {
  display: grid;
  gap: 0.75rem;
}

.article-card {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.article-card:hover,
.article-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.article-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

.article-topic {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-subject {
  font-weight: 600;
  color: var(--accent);
}

.loading,
.empty,
.error {
  margin: 1rem 0;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.error {
  color: #9b2c2c;
  border-color: #f5c6c6;
  background: #fff5f5;
}

.site-footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (min-width: 640px) {
  .site-title {
    font-size: 1.75rem;
  }

  .article-title {
    font-size: 1.2rem;
  }
}
