:root {
  --bg: #15171c;
  --surface: #1f232b;
  --surface-strong: #262b35;
  --text: #f4f6fb;
  --muted: #b7bfcc;
  --border: #363d4a;
  --accent: #4ea1ff;
  --accent-strong: #64f4d4;
  --code-bg: #0f1117;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.65;
  background:
    linear-gradient(rgba(15, 17, 23, 0.86), rgba(15, 17, 23, 0.9)),
    radial-gradient(circle at top left, rgba(78, 161, 255, 0.18), transparent 32rem),
    url("/assets/blog/images/gothic-tech-damask-circuit.png"),
    var(--bg);
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: var(--text);
}

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

a:hover,
a:focus {
  color: var(--accent-strong);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

h2 {
  font-size: 1.45rem;
}

p {
  margin-top: 0;
}

.site-header,
.site-footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
}

.site-title {
  color: var(--text);
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.site-nav a,
.read-more,
.back-link a {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
}

.site-nav a:hover,
.read-more:hover,
.back-link a:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(78, 161, 255, 0.25);
  text-decoration: none;
}

.site-main {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  text-align: center;
}

.blog-hero,
.blog-tools,
.blog-card,
.page-header,
.archive-year,
.tag-section,
.post-header,
.post-original {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.blog-hero,
.page-header,
.post-header {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.blog-hero p:last-child,
.page-header p:last-child,
.post-header p:last-child {
  margin-bottom: 0;
}

.blog-hero-link {
  color: var(--muted);
}

.eyebrow,
.post-kicker {
  margin-bottom: 0.45rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-tools {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 1rem;
}

.blog-tools label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.blog-tools input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font: inherit;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

.filter-row label {
  align-self: center;
}

.filter-row select {
  min-height: 2.55rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font: inherit;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.blog-card {
  display: flex;
  gap: 1rem;
  padding: 1.15rem;
}

.blog-card-thumb {
  flex-shrink: 0;
  width: 360px;
  height: 240px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.blog-card-body > div:first-child {
  flex: 1;
  min-width: 0;
}

.blog-card-body h2 {
  margin-bottom: 0.4rem;
}

.post-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(78, 161, 255, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.tag-list a {
  display: inline-flex;
  min-height: 1.85rem;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(100, 244, 212, 0.08);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.tag-list a:hover {
  border-color: var(--accent-strong);
  text-decoration: none;
}

.post {
  width: min(760px, 100%);
  margin: 0 auto;
}

.post-content {
  padding: 1.4rem 0;
  font-size: 1.04rem;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
}

.post-content pre {
  position: relative;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
}

.post-content code {
  padding: 0.12rem 0.28rem;
  border-radius: 5px;
  background: var(--code-bg);
  color: #d8e3ff;
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

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

.has-copy-button {
  padding-top: 2.8rem;
}

.copy-code-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  min-height: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
}

.post-original {
  margin: 0 0 1rem;
  padding: 1rem;
  color: var(--muted);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.post-nav a {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.archive-year,
.tag-section {
  margin-top: 1rem;
  padding: 1.15rem;
}

.archive-list,
.tag-section ul {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.archive-list time,
.tag-section time {
  display: inline-block;
  min-width: 6.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-search-message {
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .blog-card-body {
    flex-direction: column;
  }

  .blog-card-thumb {
    width: 100%;
    height: 160px;
  }
}
