/* ===== Cyberia / docker-ish dark retheme ===== */
:root {
  --cy-bg: #0b0f14;
  --cy-bg-2: #0e141b;
  --cy-surface: #111820;
  --cy-surface-2: #161f2a;
  --cy-border: #1f2a37;
  --cy-border-2: #2a3644;
  --cy-text: #c7d3e0;
  --cy-text-dim: #8b98a8;
  --cy-accent: #2496ed;
  --cy-accent-dim: rgba(36, 150, 237, 0.14);
  --cy-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

html {
  color-scheme: dark;
}

body {
  background-color: var(--cy-bg) !important;
  background-image:
    radial-gradient(900px 400px at 50% -180px, rgba(36, 150, 237, 0.10), transparent 70%),
    linear-gradient(180deg, #0b0f14 0%, #0a0d12 100%) !important;
  background-attachment: scroll;
  color: var(--cy-text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- tailwind dark overrides (loaded after theme css) ---------- */
.dark .dark\:bg-slate-900 { background-color: var(--cy-bg) !important; }
.dark .dark\:bg-slate-800 { background-color: var(--cy-surface) !important; }
.dark .dark\:bg-slate-700 { background-color: var(--cy-surface-2) !important; }
.dark .dark\:bg-gray-800 { background-color: rgba(10, 14, 20, 0.82) !important; }
.dark .dark\:hover\:bg-slate-700:hover { background-color: var(--cy-surface-2) !important; }
.dark .dark\:hover\:bg-slate-600:hover { background-color: #1c2836 !important; }
.dark .dark\:divide-slate-600, .dark .dark\:divide-slate-800 { border-color: var(--cy-border) !important; }
.dark .dark\:ring-slate-700 { --tw-ring-color: var(--cy-border) !important; }
.dark .dark\:border-slate-700 { border-color: var(--cy-border) !important; }
.dark .dark\:text-slate-50 { color: #e6eef8 !important; }
.dark .dark\:text-slate-100 { color: #dde7f3 !important; }
.dark .dark\:text-slate-200 { color: #b9c6d6 !important; }
.dark .dark\:text-slate-300 { color: #97a5b6 !important; }
.dark .dark\:text-slate-400 { color: #8593a4 !important; }
.dark .dark\:text-slate-500 { color: #6d7c8e !important; }
.dark .dark\:hover\:text-white:hover { color: #ffffff !important; }
.dark .dark\:hover\:text-gray-300:hover { color: var(--cy-accent) !important; }
.hover\:text-blue-600:hover { color: var(--cy-accent) !important; }

/* ---------- header ---------- */
#header-menu {
  background-color: rgba(10, 14, 20, 0.78) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--cy-border);
  box-shadow: none !important;
  height: 3.5rem;
}
#header-menu a { letter-spacing: 0.01em; }
#site-title {
  font-family: var(--cy-mono);
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: #eaf2fb !important;
}
#site-title::before {
  content: "$ ";
  color: var(--cy-accent);
  opacity: 0.9;
}

/* dropdown / popovers */
#header-menu ul[x-show], #header-menu div[x-show] {
  background-color: var(--cy-surface) !important;
  border: 1px solid var(--cy-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}

/* ---------- hero (homepage) ---------- */
.cy-hero {
  margin: 1.75rem auto 0;
  max-width: 80rem;
  padding: 0 1rem;
}
@media (min-width: 1024px) { .cy-hero { padding: 0 1.5rem; } }

.cy-hero-inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--cy-border);
  border-radius: 16px;
  padding: 2.75rem 1.5rem 2.25rem;
  background: linear-gradient(180deg, #0f1720 0%, #0b1118 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
@media (min-width: 768px) { .cy-hero-inner { padding: 3.25rem 2.25rem; } }
@media (min-width: 1024px) { .cy-hero-inner { padding: 3.75rem 3rem; } }

/* decorative grid, faded out to the right */
.cy-hero-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(130% 100% at 15% 0%, #000 25%, transparent 72%);
  -webkit-mask-image: radial-gradient(130% 100% at 15% 0%, #000 25%, transparent 72%);
}
.cy-hero-glow {
  position: absolute;
  z-index: -1;
  top: -16rem;
  right: -12rem;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(36, 150, 237, 0.22) 0%,
    rgba(36, 150, 237, 0.06) 42%,
    transparent 68%);
}

.cy-hero-body {
  position: relative;
  display: grid;
  gap: 2.25rem;
  align-items: center;
}
@media (min-width: 900px) {
  .cy-hero-body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
  }
}

.cy-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--cy-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fb9e8;
}
.cy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38e08a;
  box-shadow: 0 0 0 0 rgba(56, 224, 138, 0.5);
  animation: cy-pulse 2.4s ease-out infinite;
}
@keyframes cy-pulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 224, 138, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(56, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 224, 138, 0); }
}

.cy-title {
  margin: 0.7rem 0 0;
  font-family: var(--cy-mono);
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f4f9ff;
  text-shadow: 0 0 34px rgba(36, 150, 237, 0.28);
}
.cy-sub {
  margin-top: 0.9rem;
  max-width: 34rem;
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--cy-text-dim);
}

.cy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.9rem;
}
.cy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid var(--cy-border-2);
  color: var(--cy-text);
  background: #131b25;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.cy-btn svg { width: 1rem; height: 1rem; flex: none; }
.cy-btn:hover {
  border-color: var(--cy-accent);
  color: #fff;
  background: #17212d;
  transform: translateY(-1px);
}
.cy-btn-primary {
  background: var(--cy-accent);
  border-color: var(--cy-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(36, 150, 237, 0.25);
}
.cy-btn-primary:hover {
  background: #3ba7f5;
  border-color: #3ba7f5;
  color: #fff;
  box-shadow: 0 8px 22px rgba(36, 150, 237, 0.35);
}

.cy-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--cy-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.cy-meta-item { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.cy-meta-k { color: #5d6b7d; }
.cy-meta-v { color: #b9c9da; }
.cy-ok { color: #38e08a; }

/* terminal card */
.cy-hero-term {
  display: none;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--cy-border-2);
  border-radius: 12px;
  background: rgba(7, 11, 16, 0.78);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: var(--cy-mono);
  font-size: 0.78rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@media (min-width: 900px) { .cy-hero-term { display: block; } }

.cy-term-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}
.cy-term-dots { display: inline-flex; gap: 5px; }
.cy-term-dots i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4a5c;
}
.cy-term-dots i:nth-child(1) { background: #d9574c; }
.cy-term-dots i:nth-child(2) { background: #d9a13b; }
.cy-term-dots i:nth-child(3) { background: #3fae6a; }
.cy-term-path { color: #64758a; font-size: 0.72rem; }

.cy-term-body {
  padding: 1rem 1.15rem 1.15rem;
  line-height: 1.85;
  color: #8fa2b6;
}
.cy-term-line { color: #d6e3f0; }
.cy-prompt { color: var(--cy-accent); margin-right: 0.5rem; }
.cy-term-out { display: flex; gap: 0.9rem; }
.cy-term-key { min-width: 4.2rem; color: #61727f; }
.cy-term-val { color: #c3d3e3; }
.cy-term-last { margin-top: 0.3rem; }
.cy-cursor {
  display: inline-block;
  width: 7px;
  height: 0.95em;
  vertical-align: -0.1em;
  background: var(--cy-accent);
  animation: cy-blink 1.15s step-end infinite;
}
@keyframes cy-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cy-dot, .cy-cursor { animation: none; }
  .cy-btn:hover { transform: none; }
}

/* ---------- cards ---------- */
#post-list > div,
.group.flex.flex-col.overflow-hidden.rounded-xl {
  background-color: var(--cy-surface) !important;
  border: 1px solid var(--cy-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
#post-list > div:hover {
  border-color: rgba(36, 150, 237, 0.55) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(-2px);
  --tw-ring-shadow: 0 0 #0000 !important;
}
#post-list h1, #post-list h2 { color: #e9f1fa !important; }
#post-list h1:hover { color: var(--cy-accent) !important; }

/* filter pills */
#filters a, #filters div[class*="inline-flex"] {
  border-radius: 6px !important;
  border: 1px solid transparent;
}
#filters a:hover, #filters div[class*="inline-flex"]:hover {
  background-color: var(--cy-surface-2) !important;
  border-color: var(--cy-border-2);
}
#filters a.\!bg-gray-100, #filters a.dark\:\!bg-slate-700 {
  background-color: var(--cy-accent-dim) !important;
  border-color: rgba(36, 150, 237, 0.4) !important;
  color: #8fc3f0 !important;
}

/* ---------- article & page body ---------- */
article, .prose, .markdown-body { color: var(--cy-text); }
.prose a, .markdown-body a { color: #6ab7f5; }
.prose pre, .markdown-body pre {
  background: #0c1219 !important;
  border: 1px solid var(--cy-border);
  border-radius: 10px;
}
.prose blockquote, .markdown-body blockquote {
  border-left: 3px solid var(--cy-accent);
  background: rgba(36, 150, 237, 0.06);
  color: #a9b6c6;
}
.prose img, .markdown-body img { border-radius: 10px; }
hr { border-color: var(--cy-border) !important; }

/* footer */
footer { border-top: 1px solid var(--cy-border); background: transparent !important; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: #24303d transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #24303d; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #31404f; }

/* ---------- floating create button ---------- */
.cy-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
  background: var(--cy-surface);
  color: var(--cy-text-dim);
  font-size: 1.1rem;
  line-height: 1;
  border: 1px solid var(--cy-border-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.cy-fab:hover {
  background: var(--cy-surface-2);
  color: var(--cy-accent);
  border-color: rgba(36, 150, 237, 0.55);
  transform: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.cy-fab svg { width: 1.1rem; height: 1.1rem; }
.cy-fab svg { width: 1.35rem; height: 1.35rem; }
.cy-fab-tip {
  position: absolute;
  right: calc(100% + 0.6rem);
  white-space: nowrap;
  font-size: 0.78rem;
  font-family: var(--cy-mono);
  color: #cfdae7;
  background: var(--cy-surface-2);
  border: 1px solid var(--cy-border-2);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  opacity: 0;
  transform: translateX(4px);
  transition: all 0.16s ease;
  pointer-events: none;
}
.cy-fab:hover .cy-fab-tip { opacity: 1; transform: translateX(0); }

@media (max-width: 640px) {
  .cy-fab { right: 1rem; bottom: 1rem; }
}


/* ---------- mobile perf: drop expensive paint effects ---------- */
@media (max-width: 900px) {
  #header-menu {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: rgba(9, 13, 18, 0.96) !important;
  }
  .cy-hero-term { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cy-dot, .cy-cursor { animation: none; }
  * { scroll-behavior: auto; }
}


/* ---------- nav active state ---------- */
#header-menu ul > li > a.is-active { color: #eaf2fb !important; }
#header-menu ul > li > a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.55rem;
  height: 2px;
  border-radius: 2px;
  background: var(--cy-accent);
}
#header-menu nav a.is-active { color: var(--cy-accent) !important; }

/* ---------- post list: fill grid, protect date, split category/tag ---------- */
#post-list {
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)) !important;
}
#post-list .tabular-nums { white-space: nowrap; flex-shrink: 0; }
#post-list a[href^="/categories/"] {
  margin-right: 0 !important;
  font-family: var(--cy-mono);
  font-size: 0.72rem !important;
  letter-spacing: 0.02em;
  padding: 0.14rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--cy-border-2);
  background: var(--cy-surface-2);
  color: #9fb0c2 !important;
}
#post-list a[href^="/categories/"]:hover {
  color: #e6eef8 !important;
  border-color: rgba(36, 150, 237, 0.5);
}
#post-list a[href^="/tags/"] {
  font-style: normal;
  font-family: var(--cy-mono);
  font-size: 0.72rem !important;
  color: #5f7391 !important;
}
#post-list a[href^="/tags/"]:hover { color: var(--cy-accent) !important; }

/* ---------- sidebar widget icons: kill emoji color ---------- */
aside h2 span[class*="i-tabler"], .card-widget h2 span[class*="i-tabler"] {
  color: var(--cy-text-dim) !important;
  font-size: 0.95em !important;
}
