/* ============================================================
   Minnow Theme — Dark, modern, developer-focused
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --bg: #070b12;
  --bg-2: #0b1422;
  --bg-3: #0f1f33;
  --ink: #e6eef8;
  --muted: #9ab0c7;
  --accent: #47b3ff;
  --accent-2: #6cf7c8;
  --line: rgba(154, 176, 199, 0.18);
  --card: rgba(10, 20, 33, 0.7);
  --glow: rgba(71, 179, 255, 0.35);
  --mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "Sora", "IBM Plex Sans", "Segoe UI", sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg-3); }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg-3);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(1400px 800px at 10% -10%, rgba(71, 179, 255, 0.14), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(108, 247, 200, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
}

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

/* --- Ocean Grid Background --- */
.ocean-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(154, 176, 199, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 176, 199, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 20%, rgba(0,0,0,1), rgba(0,0,0,0.2) 65%, transparent 80%);
  z-index: 0;
}

/* --- Layout --- */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* --- Site Header --- */
header {
  padding: 28px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

a.brand { text-decoration: none; }
a.brand:hover { color: var(--ink); }

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  box-shadow: 0 0 18px var(--accent-2);
}

nav {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  align-items: center;
}

nav li {
  margin: 0;
  padding: 0;
}

nav li::marker { content: none; }

nav a {
  color: inherit;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: translateY(-5px);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  padding-bottom: 0;
}

nav .nav-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

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

nav .nav-icon:hover {
  border-color: var(--line);
  background: rgba(7, 11, 18, 0.6);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink);
  text-decoration: none;
  background: rgba(7, 11, 18, 0.65);
  transition: all 180ms ease;
}

.btn.primary {
  background: linear-gradient(120deg, rgba(71, 179, 255, 0.2), rgba(108, 247, 200, 0.16));
  border-color: rgba(71, 179, 255, 0.35);
  box-shadow: 0 0 30px rgba(71, 179, 255, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--ink);
}

/* --- Hero (home.html) --- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(10, 20, 33, 0.9), rgba(7, 11, 18, 0.9));
  border: 1px solid var(--line);
  padding: 26px;
  overflow: hidden;
  min-height: 320px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(71, 179, 255, 0.22), transparent 70%);
  filter: blur(2px);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -20%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 247, 200, 0.18), transparent 70%);
}

.fish {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fish svg {
  width: 140px;
  height: auto;
  animation: swim 6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--glow));
}

@keyframes swim {
  0%, 100% { transform: translateX(-10px) translateY(0); }
  50% { transform: translateX(10px) translateY(-6px); }
}

.code-block {
  margin-top: 10px;
  border-radius: 16px;
  padding: 18px 20px;
  background: rgba(7, 12, 20, 0.8);
  border: 1px solid rgba(71, 179, 255, 0.2);
  font-family: var(--mono);
  font-size: 12px;
  color: #cfe3ff;
  line-height: 1.6;
}

/* --- Sections (reusable in page content) --- */
.section {
  padding: 60px 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 12px;
}

.section p {
  color: var(--muted);
  margin: 0 0 26px;
  max-width: 760px;
  line-height: 1.7;
}

.tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-2);
  margin-bottom: 10px;
}

/* --- Grid & Cards (reusable in page content) --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

/* --- Pipeline Steps (reusable in page content) --- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.pipeline-step {
  border: 1px dashed rgba(71, 179, 255, 0.4);
  border-radius: 14px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.pipeline-step strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

/* --- Roadmap (reusable in page content) --- */
.roadmap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.roadmap-list {
  display: grid;
  gap: 12px;
}

.roadmap-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(10, 20, 33, 0.65);
  border: 1px solid rgba(154, 176, 199, 0.2);
  font-size: 13px;
  line-height: 1.5;
}

/* --- Page Content (default.html, post.html) --- */
.page-main {
  padding: 40px 0 60px;
  min-height: 50vh;
}

.page-header h1,
.post-header h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.post-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-meta .separator { opacity: 0.5; }

/* --- Docs Layout --- */
.docs-main {
  padding: 30px 0 60px;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 18px;
  border-radius: 16px;
  background: rgba(10, 20, 33, 0.65);
  border: 1px solid rgba(154, 176, 199, 0.2);
}

.docs-sidebar h2 {
  margin: 10px 0 14px;
  font-size: 18px;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 160ms ease;
}

.docs-link:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(7, 11, 18, 0.6);
}

.docs-link.active {
  color: var(--ink);
  border-color: rgba(71, 179, 255, 0.35);
  background: rgba(7, 11, 18, 0.7);
  box-shadow: 0 0 20px rgba(71, 179, 255, 0.15);
}

.docs-content .page-header {
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }
}

.post-meta .categories a {
  color: var(--accent);
  text-decoration: none;
}

.post-meta .categories a:hover { color: var(--accent-2); }

/* --- Markdown Body / Content Typography --- */
.markdown-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 760px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 2em 0 0.6em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body h3 { font-size: 1.25em; }

.markdown-body p {
  margin: 0 0 1.2em;
  color: var(--muted);
}

.markdown-body strong { color: var(--ink); }

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body a:hover { color: var(--accent-2); }

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin: 0 0 1.2em;
  color: var(--muted);
}

.markdown-body li { margin-bottom: 0.4em; }
.markdown-body li strong { color: var(--ink); }

.markdown-body blockquote {
  margin: 1.5em 0;
  padding: 0.8em 1.2em;
  border-left: 3px solid var(--accent);
  background: rgba(71, 179, 255, 0.06);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
}

.markdown-body blockquote p { margin: 0; }

.markdown-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  background: rgba(71, 179, 255, 0.1);
  border: 1px solid rgba(71, 179, 255, 0.15);
  border-radius: 6px;
  color: var(--accent);
}

.markdown-body pre {
  margin: 1.5em 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(7, 12, 20, 0.8);
  border: 1px solid rgba(71, 179, 255, 0.2);
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: 13px;
  color: #cfe3ff;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 1.5em 0;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.markdown-body th {
  font-weight: 600;
  color: var(--ink);
}

.markdown-body td {
  color: var(--muted);
}

/* --- Post Footer / Tags --- */
.post-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tags a {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: all 150ms ease;
}

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

/* --- Post Navigation --- */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post-navigation a {
  display: block;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: all 150ms ease;
}

.post-navigation a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-navigation .nav-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 6px;
}

.post-navigation .nav-title {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.post-navigation .nav-next { text-align: right; }

/* --- Archive / Post Cards --- */
.archive-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.archive-header h1 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 8px;
}

.archive-header p {
  color: var(--muted);
  margin: 0;
}

.post-card {
  border-bottom: 1px solid var(--line);
}

.post-card-inner {
  padding: 24px 0;
}

.post-card h2 {
  font-size: 20px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.post-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

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

.post-card p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.no-posts {
  color: var(--muted);
  font-size: 16px;
  padding: 40px 0;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0 20px;
  font-size: 13px;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 150ms ease;
}

.pagination a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pagination .page-info {
  color: var(--muted);
}

/* --- 404 Page --- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.error-content {
  text-align: center;
}

.error-content h1 {
  font-size: clamp(64px, 12vw, 140px);
  margin: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.error-content p {
  color: var(--muted);
  font-size: 18px;
  margin: 12px 0 28px;
}

/* --- Site Footer --- */
.footer {
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
}

/* --- Admin Bar (logged-in frontend) --- */
.minnow-admin-bar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(10, 20, 33, 0.85);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

.admin-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(7, 11, 18, 0.65);
  border: 1px solid transparent;
  transition: all 150ms ease;
}

.admin-bar-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--glow);
  transform: translateY(-1px);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  nav { display: none; }
}

@media (max-width: 600px) {
  .post-navigation { grid-template-columns: 1fr; }
}
