/* Default Theme Styles (Dark) */
:root {
  --color-primary: #3b82f6;
  --color-secondary: #64748b;
  --color-accent: #06b6d4;
  --color-text: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-bg: #111827;
  --color-bg-alt: #1f2937;
  --color-border: #374151;
  --color-chrome: #0a0e1a;
  --color-glow: rgba(6, 182, 212, 0.1);
  --font-heading: system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --max-width: 768px;
}

/* --- Themes --- */
[data-theme="ocean"] {
  --color-primary: #3b82f6;
  --color-accent: #06b6d4;
  --color-bg: #111827;
  --color-bg-alt: #1f2937;
  --color-border: #374151;
  --color-chrome: #0a0e1a;
  --color-glow: rgba(6, 182, 212, 0.1);
}
[data-theme="ember"] {
  --color-primary: #7a3a0a;
  --color-accent: #651c1a;
  --color-bg: #141010;
  --color-bg-alt: #1e1614;
  --color-border: #33221a;
  --color-chrome: #0a0807;
  --color-glow: rgba(122, 58, 10, 0.06);
}
[data-theme="emerald"] {
  --color-primary: #10b981;
  --color-accent: #34d399;
  --color-bg: #0f1a16;
  --color-bg-alt: #1a2b24;
  --color-border: #2d4a3e;
  --color-chrome: #0a120f;
  --color-glow: rgba(16, 185, 129, 0.1);
}
[data-theme="violet"] {
  --color-primary: #a855f7;
  --color-accent: #ec4899;
  --color-bg: #1a1028;
  --color-bg-alt: #261a38;
  --color-border: #3d2a56;
  --color-chrome: #110a1c;
  --color-glow: rgba(168, 85, 247, 0.1);
}
[data-theme="gold"] {
  --color-primary: #eab308;
  --color-accent: #f59e0b;
  --color-bg: #1a1708;
  --color-bg-alt: #2a2510;
  --color-border: #44391a;
  --color-chrome: #121005;
  --color-glow: rgba(234, 179, 8, 0.1);
}
[data-theme="rose"] {
  --color-primary: #f43f5e;
  --color-accent: #fb7185;
  --color-bg: #1c1012;
  --color-bg-alt: #2a181c;
  --color-border: #44282e;
  --color-chrome: #120a0c;
  --color-glow: rgba(244, 63, 94, 0.1);
}
[data-theme="neon"] {
  --color-primary: #22d3ee;
  --color-accent: #a3e635;
  --color-bg: #0a1214;
  --color-bg-alt: #141e22;
  --color-border: #1e3038;
  --color-chrome: #060c0e;
  --color-glow: rgba(34, 211, 238, 0.12);
}
[data-theme="arctic"] {
  --color-primary: #94a3b8;
  --color-accent: #cbd5e1;
  --color-bg: #0f172a;
  --color-bg-alt: #1e293b;
  --color-border: #334155;
  --color-chrome: #090e1a;
  --color-glow: rgba(148, 163, 184, 0.08);
}
[data-theme="sakura"] {
  --color-primary: #f9a8d4;
  --color-accent: #c084fc;
  --color-bg: #1a1018;
  --color-bg-alt: #28182a;
  --color-border: #3e2840;
  --color-chrome: #120a14;
  --color-glow: rgba(249, 168, 212, 0.1);
}
[data-theme="rust"] {
  --color-primary: #dc6843;
  --color-accent: #b45c3a;
  --color-bg: #1a1210;
  --color-bg-alt: #261c18;
  --color-border: #3e2e26;
  --color-chrome: #100c0a;
  --color-glow: rgba(220, 104, 67, 0.1);
}
[data-theme="matrix"] {
  --color-primary: #22c55e;
  --color-accent: #4ade80;
  --color-bg: #0a120a;
  --color-bg-alt: #141e14;
  --color-border: #1e331e;
  --color-chrome: #060e06;
  --color-glow: rgba(34, 197, 94, 0.12);
}
[data-theme="midnight"] {
  --color-primary: #6366f1;
  --color-accent: #818cf8;
  --color-bg: #10101e;
  --color-bg-alt: #1a1a30;
  --color-border: #2a2a4a;
  --color-chrome: #0a0a16;
  --color-glow: rgba(99, 102, 241, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; line-height: 1.6; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 2rem 0; flex: 1; }
main.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
main.coming-soon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/images/bg.png") center / cover no-repeat;
  opacity: 0.07;
  pointer-events: none;
}
main.coming-soon .container {
  position: relative;
  z-index: 1;
}
main.coming-soon .site-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
main.coming-soon > .container p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 0.4rem 0;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.12);
  font-size: 0.6rem;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Site title */
.site-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-title:hover { text-decoration: none; color: var(--color-primary); }

/* Navigation */
.site-nav {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.site-nav ul { list-style: none; display: flex; gap: 1.5rem; }
.site-nav a { color: var(--color-text-muted); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.site-nav a:hover { color: var(--color-primary); text-decoration: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1.5rem; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Article content */
article { max-width: 100%; }
article .content { line-height: 1.8; }

article .content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

article .content pre {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.5rem 0;
}

article .content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

article .content pre code { background: none; padding: 0; }

article .content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

article .content ul,
article .content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

article .content li { margin-bottom: 0.5rem; }

article .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

article .content th,
article .content td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  text-align: left;
}

article .content th { background: var(--color-bg-alt); font-weight: 600; }

/* Post meta */
article header { border: none; padding: 0; margin-bottom: 1.5rem; }
time { color: var(--color-text-muted); font-size: 0.875rem; }
.author, .reading-time {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.tag {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.tag:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }

/* Post cards (list pages) */
.post-card {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.post-card:last-child { border-bottom: none; }
.post-card h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.post-card h2 a { color: var(--color-text); }
.post-card h2 a:hover { color: var(--color-primary); text-decoration: none; }
.excerpt { color: var(--color-text-muted); margin-top: 0.5rem; }
.description { color: var(--color-text-muted); margin-bottom: 2rem; }

/* Post navigation (prev/next) */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.page-info { color: var(--color-text-muted); font-size: 0.875rem; }

/* Recent posts */
.recent-posts { margin-top: 3rem; }
.recent-posts ul { list-style: none; padding: 0; }
.recent-posts li { margin-bottom: 0.75rem; }
.recent-posts p { color: var(--color-text-muted); font-size: 0.875rem; margin: 0; }

/* Theme picker */
.theme-picker {
  position: relative;
}
.theme-picker-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-body);
  transition: border-color 0.2s, color 0.2s;
}
.theme-picker-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}
.theme-picker-btn .swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
}
.theme-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--color-chrome);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  min-width: 160px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.theme-dropdown.open { display: block; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  width: 100%;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.theme-option:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}
.theme-option.active {
  color: var(--color-primary);
}
.theme-option .swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

