:root {
  --font-family: "Segoe UI", Arial, sans-serif;
  --bg-start: #232526;
  --bg-end: #414345;
  --surface: rgba(0, 0, 0, 0.6);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-muted: #b3b3b3;
  --text-body: #e0e0e0;
  --accent-blue: #7ecfff;
  --accent-blue-tint: rgba(126, 207, 255, 0.12);
  --accent-fuchsia: #f102ce;
  --accent-fuchsia-shadow: 0 2px 8px 0 rgba(241, 2, 206, 0.2);
  --accent-lime: #39ff14;
  --accent-orange: #ff5722;
  --accent-purple: #a020f0;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.22);
  --radius: 16px;
  --content-width: min(1120px, calc(100vw - 2rem));
}

:root[data-theme="light"] {
  --bg-start: #f5f7fa;
  --bg-end: #e4e8f0;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-soft: rgba(0, 0, 0, 0.03);
  --surface-border: rgba(17, 18, 21, 0.1);
  --text-primary: #111215;
  --text-muted: #60646c;
  --text-body: #2d3139;
  --shadow-soft: 0 18px 45px rgba(28, 42, 61, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  background:
    radial-gradient(circle at top, rgba(241, 2, 206, 0.15), transparent 30%),
    linear-gradient(160deg, var(--bg-start), var(--bg-end));
  color: var(--text-body);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

img {
  max-width: 100%;
}

.site-shell {
  min-height: 100vh;
}

.page-shell,
.site-header__inner,
.site-footer__inner {
  width: var(--content-width);
  margin: 0 auto;
}

.page-shell {
  padding: 2rem 0 4rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg-start) 55%, transparent);
  border-bottom: 1px solid var(--surface-border);
}

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

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.site-brand__emoji {
  font-size: 1.5rem;
}

.site-brand strong,
.site-brand small {
  display: block;
}

.site-brand small,
.site-nav a,
.post-card__meta,
.post-hero__meta,
.site-footer {
  color: var(--text-muted);
}

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

.theme-toggle,
.button,
.tag-pill {
  border: 1px solid transparent;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.theme-toggle {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-soft);
  border-color: var(--surface-border);
}

.theme-toggle:hover,
.button:hover,
.tag-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(241, 2, 206, 0.3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.hero-panel,
.page-section,
.empty-state,
.prose-shell {
  padding: 1.5rem;
}

.hero-panel {
  padding: 2rem;
}

.hero h1,
.section-heading h1,
.section-heading h2,
.post-hero h1,
.empty-state h1 {
  color: var(--text-primary);
  margin: 0;
}

.hero-copy,
.section-heading p,
.empty-state p {
  max-width: 65ch;
}

.eyebrow {
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-fuchsia);
  font-size: 0.82rem;
}

.hero-actions,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
}

.button--primary {
  color: #111215;
  background: var(--accent-blue);
}

.button--ghost {
  color: var(--text-primary);
  background: var(--surface-soft);
  border-color: var(--surface-border);
}

.section-grid,
.post-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.section-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.5rem 0 2rem;
}

.post-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.page-section + .page-section {
  margin-top: 1.5rem;
}

.section-card,
.post-card {
  padding: 1.25rem;
}

.section-card__header,
.section-heading,
.post-card h3 {
  margin-bottom: 1rem;
}

.section-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-list a,
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: var(--accent-blue-tint);
  color: var(--text-primary);
  border-color: rgba(126, 207, 255, 0.2);
}

.tag-pill strong {
  color: var(--accent-lime);
}

.post-card__meta,
.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.post-card h3 a {
  color: var(--text-primary);
}

.post-card p {
  margin-bottom: 1rem;
}

.prose-shell {
  padding: 2rem;
}

.post-hero {
  margin-bottom: 2rem;
}

.prose {
  color: var(--text-body);
  line-height: 1.75;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text-primary);
  line-height: 1.2;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--surface-border);
  margin: 2rem 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-fuchsia);
  background: rgba(241, 2, 206, 0.08);
  border-radius: 0 12px 12px 0;
}

.prose code {
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.prose pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.36);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--surface-border);
  text-align: left;
}

.back-link {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
}

.empty-state {
  margin-top: 2rem;
}

.site-footer {
  padding-bottom: 2rem;
}

.site-footer__inner {
  border-top: 1px solid var(--surface-border);
}

@media (max-width: 720px) {
  .site-header__inner,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-shell {
    padding-top: 1.25rem;
  }

  .hero-panel,
  .prose-shell {
    padding: 1.25rem;
  }

  .back-link {
    flex-direction: column;
  }
}
