/* IndieWeb-inspired minimal design */
:root, :root.auto, :root.auto light {
  --bg: #fffbf4;
  --text: #2a2a2a;
  --text-muted: #666;
  --accent: #1a0aab;
  --border: #e8e2d8;
  --code-bg: #f4f1eb;
  --card-bg: #fffef9;
  --mode-icon: "☀️";
}

:root.auto dark {
  --bg: #1a1915;
  --text: #e8e2d8;
  --text-muted: #999;
  --accent: #7eb3ff;
  --border: #333;
  --code-bg: #252320;
  --card-bg: #1f1e1a;
  --mode-icon: "🌙";
}

:root.light {
  --bg: #fffbf4;
  --text: #2a2a2a;
  --text-muted: #666;
  --accent: #1a0aab;
  --border: #e8e2d8;
  --code-bg: #f4f1eb;
  --card-bg: #fffef9;
  --mode-icon: "☀️";
}

:root.dark {
  --bg: #1a1915;
  --text: #e8e2d8;
  --text-muted: #999;
  --accent: #7eb3ff;
  --border: #333;
  --code-bg: #252320;
  --card-bg: #1f1e1a;
  --mode-icon: "🌙";
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  transition: background-color 0.2s, color 0.2s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { text-decoration-style: wavy; }

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

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

header nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

header nav a {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

.cursor { animation: blink 0.8s infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

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

article:last-child { border-bottom: none; }

article h2 { font-size: 1.15rem; margin-bottom: 0.3rem; }
article h2 a { color: var(--text); text-decoration: none; }
article h2 a:hover { color: var(--accent); }

article .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: 'Inter', sans-serif;
}

article .badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

article .excerpt { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0.5rem; }
article .read-more { font-family: 'Inter', sans-serif; font-size: 0.85rem; }

.home-section { margin-bottom: 3rem; }
.home-section .section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.badge-cve, .badge-event {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.25rem;
  font-weight: 600;
}
.home-section article .title-plain a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.home-section article .title-plain a:hover { color: var(--accent); }
.badge-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}
.badge-tag:hover { color: var(--accent); }
.home-section article {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.home-section article:last-child { border-bottom: none; }
.home-section article h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 400;
}
.home-section article .title-plain {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}
.home-section article h2 a {
  color: var(--text);
  text-decoration: none;
}

.single-article { padding-bottom: 3rem; }
.single-article h1 { font-size: 1.5rem; margin-bottom: 0.5rem; line-height: 1.3; }
.single-article .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-family: 'Inter', sans-serif;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.single-article .meta .badge {
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.single-article h2 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.single-article h3 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.single-article p { margin-bottom: 1rem; }
.single-article ul, .single-article ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.single-article li { margin-bottom: 0.3rem; }
.single-article a { color: var(--accent); }
.single-article code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
.single-article pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.single-article pre code { background: none; padding: 0; font-size: inherit; }
.single-article blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.single-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}
.single-article th, .single-article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.single-article th { background: var(--code-bg); font-weight: 600; }

.advisories-page h1, .disclosures-page h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.advisories-page .page-subtitle, .disclosures-page .page-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  font-family: 'Inter', sans-serif;
}

.advisories-table, .disclosures-table { width: 100%; font-family: 'Inter', sans-serif; font-size: 0.9rem; }
.advisories-table .header, .disclosures-table .header {
  display: grid;
  grid-template-columns: 130px 1fr 90px 80px 80px;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.advisories-table .row, .disclosures-table .row {
  display: grid;
  grid-template-columns: 130px 1fr 90px 80px 80px;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.advisories-table .row:hover { background: var(--code-bg); margin: 0 -0.5rem; padding: 0.75rem 0.5rem; border-radius: 4px; }
.advisories-table .cve, .disclosures-table .cve { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--accent); }
.advisories-table .cwe-link, .disclosures-table .cwe-link { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text-muted); text-decoration: none; }
.advisories-table .cwe-link:hover, .disclosures-table .cwe-link:hover { color: var(--accent); }
.advisories-table .title, .disclosures-table .title { color: var(--text); text-decoration: none; font-weight: 500; }
.advisories-table .title:hover, .disclosures-table .title:hover { color: var(--accent); }
.advisories-table .date, .disclosures-table .date { color: var(--text-muted); font-size: 0.8rem; }
.advisories-table .severity, .disclosures-table .severity {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  text-align: center;
}

.severity-critical { color: #b91c1c; background: #fef2f2; }
.severity-high { color: #c2410c; background: #fff7ed; }
.severity-medium { color: #a16207; background: #fefce8; }
.severity-low { color: #15803d; background: #f0fdf4; }

@media (prefers-color-scheme: dark) {
  .severity-critical { color: #fca5a5; background: #450a0a; }
  .severity-high { color: #fdba74; background: #431407; }
  .severity-medium { color: #fde047; background: #422006; }
  .severity-low { color: #86efac; background: #052e16; }
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--accent); }

.cwe-info {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cwe-info a { color: var(--accent); }

.cwe-mitre-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
}

.cwe-mitre-link:hover { color: var(--accent); }

.header-link {
  color: var(--text-muted);
  text-decoration: none;
}

.header-link:hover { color: var(--accent); }

.cwe-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
}

.cwe-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
}

.cwe-item:hover { border-color: var(--accent); }

.cwe-item .cwe-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.cwe-item .cwe-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

footer {
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}
footer a { color: var(--text-muted); }

@media (max-width: 600px) {
  body { font-size: 16px; padding: 0 1rem; }
  .advisories-table .header, .disclosures-table .header { display: none; }
  .advisories-table .row, .disclosures-table .row { grid-template-columns: 1fr; gap: 0.3rem; padding: 1rem 0; }
  .advisories-table .date, .disclosures-table .date { font-size: 0.75rem; }
  .advisories-table .severity, .disclosures-table .severity { justify-self: start; }
  .advisories-table .cve, .disclosures-table .cve { justify-self: start; }
  .advisories-table .cwe-link, .disclosures-table .cwe-link { justify-self: start; }
}