/* ============================================================
   firstdaycode.xyz — Pixel-Retro Tech Blog
   White-blue palette + 8-bit aesthetic + modern clean layout
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* Core palette */
  --white: #FFFFFF;
  --ice: #F0F7FF;
  --frost: #E1EEFB;
  --sky: #B8D8F8;
  --azure: #5BA4E6;
  --cobalt: #2B7CD8;
  --deep: #1A5BA0;
  --midnight: #0D2B4A;
  --ink: #081C32;

  /* Accents */
  --pixel-cyan: #00E5FF;
  --pixel-green: #39FF14;
  --pixel-pink: #FF6EC7;

  /* Semantic */
  --bg: var(--white);
  --bg-alt: var(--ice);
  --bg-card: var(--white);
  --text: var(--ink);
  --text-muted: #5A7A99;
  --text-light: var(--deep);
  --border: var(--frost);
  --accent: var(--cobalt);
  --accent-hover: var(--deep);
  --highlight: var(--pixel-cyan);

  /* Pixel border */
  --pixel-border: 3px solid var(--accent);
  --pixel-shadow:
    3px 0 0 0 var(--accent),
    -3px 0 0 0 var(--accent),
    0 3px 0 0 var(--accent),
    0 -3px 0 0 var(--accent);

  /* Layout */
  --max-w: 1120px;
  --gap: 1.5rem;
  --radius: 0;

  /* Type scale */
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
  --font-pixel: 'Silkscreen', 'Press Start 2P', cursive;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.75rem;
  --fs-3xl: 3.5rem;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.25s;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #060E18;
  --bg-alt: #0C1829;
  --bg-card: #101E30;
  --text: #E8F0F8;
  --text-muted: #7A9CBB;
  --text-light: var(--sky);
  --border: #1A2E44;
  --accent: var(--azure);
  --accent-hover: var(--pixel-cyan);
  --highlight: var(--pixel-cyan);
  --pixel-border: 3px solid var(--azure);
  --pixel-shadow:
    3px 0 0 0 var(--azure),
    -3px 0 0 0 var(--azure),
    0 3px 0 0 var(--azure),
    0 -3px 0 0 var(--azure);
}

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

/* --- Base --- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* Pixel cursor on interactive elements */
a:hover, button:hover, .pixel-hover:hover {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect x='4' y='0' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='0' y='4' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%235BA4E6'/%3E%3Crect x='8' y='4' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='4' y='8' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%235BA4E6'/%3E%3Crect x='12' y='8' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='8' y='12' width='4' height='4' fill='%232B7CD8'/%3E%3Crect x='12' y='12' width='4' height='4' fill='%235BA4E6'/%3E%3C/svg%3E") 0 0, pointer;
}

/* --- Pixel Decorative Elements --- */

/* 8-bit corner ornaments */
.pixel-corners {
  position: relative;
}

.pixel-corners::before,
.pixel-corners::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  image-rendering: pixelated;
}

.pixel-corners::before {
  top: -3px;
  left: -3px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 0 / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 0 / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 4px / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 8px / 4px 4px no-repeat;
}

.pixel-corners::after {
  bottom: -3px;
  right: -3px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 8px / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 8px / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 8px / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 4px / 4px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 0 / 4px 4px no-repeat;
}

/* Pixelated divider */
.pixel-divider {
  height: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--accent) 0 4px,
      transparent 4px 8px,
      var(--sky) 8px 12px,
      transparent 12px 16px
    );
  image-rendering: pixelated;
  margin: 2rem 0;
}

/* Pixel badge */
.pixel-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  padding: 4px 10px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--pixel-shadow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  image-rendering: pixelated;
}

/* Pixel tag */
.pixel-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  padding: 3px 8px;
  border: var(--pixel-border);
  color: var(--accent);
  background: var(--bg);
  transition: all var(--duration) var(--ease);
}

.pixel-tag:hover {
  background: var(--accent);
  color: var(--white);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.container--narrow {
  max-width: 780px;
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: var(--pixel-border);
  transition: background var(--duration) var(--ease);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.site-logo__icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.site-logo__text {
  font-family: var(--font-pixel);
  font-size: var(--fs-sm);
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-logo__text span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav__link {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
  position: relative;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  transition: width var(--duration) var(--ease);
  image-rendering: pixelated;
}

.site-nav__link:hover::after,
.site-nav__link--active::after {
  width: 100%;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: var(--pixel-border);
  color: var(--accent);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all var(--duration) var(--ease);
  image-rendering: pixelated;
  cursor: pointer;
}

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 3px;
  background: var(--text);
  transition: all var(--duration) var(--ease);
  image-rendering: pixelated;
}

/* --- Hero / Featured Post --- */
.hero {
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(91, 164, 230, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 229, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

/* Pixel grid background pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--frost) 1px, transparent 1px),
    linear-gradient(90deg, var(--frost) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
}

[data-theme="dark"] .hero::after {
  background-image:
    linear-gradient(rgba(91, 164, 230, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 164, 230, 0.06) 1px, transparent 1px);
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__label {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero__label::before {
  content: '>';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__title {
  font-family: var(--font-pixel);
  font-size: clamp(1.75rem, 4vw, var(--fs-3xl));
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 800px;
}

.hero__excerpt {
  font-size: var(--fs-md);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.hero__meta-sep {
  width: 4px;
  height: 4px;
  background: var(--accent);
  image-rendering: pixelated;
}

/* --- Blog Grid --- */
.blog-section {
  padding: 3rem 0 4rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: var(--fs-lg);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '//';
  color: var(--accent);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}

/* --- Post Card --- */
.post-card {
  background: var(--bg-card);
  border: var(--pixel-border);
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-card:hover {
  transform: translate(-3px, -3px);
  box-shadow:
    3px 3px 0 0 var(--accent),
    6px 6px 0 0 var(--sky);
}

.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: var(--pixel-border);
  image-rendering: auto;
  background: var(--frost);
}

.post-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-card__title {
  font-family: var(--font-pixel);
  font-size: var(--fs-sm);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-card__title a {
  color: inherit;
}

.post-card__title a:hover {
  color: var(--accent);
}

.post-card__excerpt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.post-card__read-more {
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-card__read-more::after {
  content: '>>';
}

/* --- Featured Card (large) --- */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: var(--pixel-border);
  margin-bottom: 3rem;
  transition: all var(--duration) var(--ease);
}

.featured-card:hover {
  transform: translate(-3px, -3px);
  box-shadow:
    3px 3px 0 0 var(--accent),
    6px 6px 0 0 var(--sky);
}

.featured-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-right: var(--pixel-border);
  min-height: 300px;
  background: var(--frost);
}

.featured-card__body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card__label {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--pixel-cyan);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.featured-card__title {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2vw, var(--fs-lg));
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.featured-card__title a {
  color: inherit;
}

.featured-card__title a:hover {
  color: var(--accent);
}

.featured-card__excerpt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.featured-card__meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* --- Article Page --- */
.article-header {
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
}

.article-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--frost) 1px, transparent 1px),
    linear-gradient(90deg, var(--frost) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.3;
  pointer-events: none;
}

[data-theme="dark"] .article-header::after {
  background-image:
    linear-gradient(rgba(91, 164, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 164, 230, 0.04) 1px, transparent 1px);
}

.article-header__inner {
  position: relative;
  z-index: 1;
}

.article-header .pixel-badge {
  margin-bottom: 1rem;
}

.article-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.5rem, 3.5vw, var(--fs-2xl));
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-meta__sep {
  width: 4px;
  height: 4px;
  background: var(--accent);
}

/* Table of Contents */
.toc {
  background: var(--bg-alt);
  border: var(--pixel-border);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.toc__title {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.toc__list {
  list-style: none;
  counter-reset: toc;
}

.toc__list li {
  counter-increment: toc;
  padding: 0.25rem 0;
}

.toc__list li::before {
  content: '0' counter(toc) '.';
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--accent);
  margin-right: 0.5rem;
}

.toc__list a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

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

/* Article Content */
.article-content {
  padding: 2rem 0 3rem;
}

.article-body {
  font-size: var(--fs-md);
  line-height: 1.8;
}

.article-body h2 {
  font-family: var(--font-pixel);
  font-size: var(--fs-lg);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text);
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
}

.article-body h3 {
  font-family: var(--font-pixel);
  font-size: var(--fs-base);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body code {
  font-family: var(--font-body);
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border: 1px solid var(--border);
}

.article-body pre {
  background: var(--ink);
  color: var(--sky);
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  border: var(--pixel-border);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.article-body img {
  border: var(--pixel-border);
  margin: 1.5rem 0;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Article tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

/* Author Bio */
.author-bio {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-alt);
  border: var(--pixel-border);
  padding: 1.5rem;
  margin: 2rem 0;
}

.author-bio__avatar {
  width: 64px;
  height: 64px;
  border: var(--pixel-border);
  image-rendering: pixelated;
  flex-shrink: 0;
  background: var(--frost);
}

.author-bio__name {
  font-family: var(--font-pixel);
  font-size: var(--fs-sm);
  margin-bottom: 0.25rem;
  color: var(--text);
}

.author-bio__role {
  font-size: var(--fs-xs);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.author-bio__desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Related posts */
.related-posts {
  padding: 2rem 0 3rem;
}

/* --- About Page --- */
.about-hero {
  padding: 4rem 0 2rem;
  text-align: center;
  position: relative;
}

.about-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--frost) 1px, transparent 1px),
    linear-gradient(90deg, var(--frost) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

[data-theme="dark"] .about-hero::after {
  background-image:
    linear-gradient(rgba(91, 164, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 164, 230, 0.05) 1px, transparent 1px);
}

.about-hero__inner {
  position: relative;
  z-index: 1;
}

.about-hero__title {
  font-family: var(--font-pixel);
  font-size: clamp(1.75rem, 4vw, var(--fs-2xl));
  margin-bottom: 1rem;
}

.about-hero__subtitle {
  font-size: var(--fs-md);
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.about-content {
  padding: 2rem 0 3rem;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section__title {
  font-family: var(--font-pixel);
  font-size: var(--fs-base);
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-section__title::before {
  content: '>';
  color: var(--pixel-cyan);
}

.about-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  border: var(--pixel-border);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--duration) var(--ease);
}

.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    2px 2px 0 0 var(--accent),
    4px 4px 0 0 var(--sky);
}

.stat-card__number {
  font-family: var(--font-pixel);
  font-size: var(--fs-xl);
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

.stat-card__label {
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Tech stack */
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

/* --- Newsletter --- */
.newsletter {
  background: var(--bg-alt);
  border: var(--pixel-border);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

.newsletter__title {
  font-family: var(--font-pixel);
  font-size: var(--fs-base);
  margin-bottom: 0.5rem;
  color: var(--text);
}

.newsletter__desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.newsletter__form {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
}

.newsletter__input {
  flex: 1;
  padding: 0.625rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  border: var(--pixel-border);
  border-right: none;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.newsletter__input:focus {
  border-color: var(--pixel-cyan);
}

.newsletter__btn {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: var(--white);
  border: var(--pixel-border);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-transform: uppercase;
  white-space: nowrap;
}

.newsletter__btn:hover {
  background: var(--deep);
  box-shadow:
    2px 2px 0 0 var(--sky);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pagination__btn {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  padding: 6px 12px;
  border: var(--pixel-border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.pagination__btn:hover,
.pagination__btn--active {
  background: var(--accent);
  color: var(--white);
}

.pagination__btn--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* --- Footer --- */
.site-footer {
  border-top: var(--pixel-border);
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer__copy {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.site-footer__links {
  display: flex;
  gap: 1rem;
}

.site-footer__link {
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

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

/* Pixel art decoration in footer */
.site-footer__pixel-art {
  display: flex;
  gap: 3px;
  margin-top: 0.5rem;
}

.site-footer__pixel-art span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  image-rendering: pixelated;
}

.site-footer__pixel-art span:nth-child(2n) {
  background: var(--sky);
}

.site-footer__pixel-art span:nth-child(3n) {
  background: var(--pixel-cyan);
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--white);
  padding: 0.5rem 1rem;
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  z-index: 9999;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: var(--pixel-border);
    flex-direction: column;
    padding: 1rem var(--gap);
    gap: 0.75rem;
  }

  .site-nav--open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero__title {
    font-size: clamp(1.25rem, 5vw, 2rem);
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card__image {
    border-right: none;
    border-bottom: var(--pixel-border);
    min-height: 200px;
  }

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

  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .newsletter__form {
    flex-direction: column;
  }

  .newsletter__input {
    border-right: var(--pixel-border);
    border-bottom: none;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Print --- */
@media print {
  .site-header, .site-footer, .theme-toggle, .newsletter, .toc, .nav-toggle {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .article-body a::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease) both;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }
.animate-in:nth-child(5) { animation-delay: 0.2s; }
.animate-in:nth-child(6) { animation-delay: 0.25s; }

/* Pixel loading bar */
@keyframes pixelLoad {
  0% { width: 0; }
  100% { width: 100%; }
}

.pixel-loading {
  height: 3px;
  background: var(--accent);
  animation: pixelLoad 1.5s var(--ease) forwards;
  image-rendering: pixelated;
}
