/* ── nashinode · coder-modern theme ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Softer charcoal palette */
  --bg:        #10131a;
  --bg-2:      #161b25;
  --surface:   #181f2b;
  --surface-2: #202838;
  --border:    #293244;
  --border-2:  #374259;
  --text:      #d2dbef;
  --text-dim:  #b1bcd1;
  --muted:     #7a8299;
  --accent:    #88a7ff;
  --accent-2:  #c2a0ff;
  --green:     #9ece6a;
  --yellow:    #e0af68;
  --red:       #f7768e;
  --cyan:      #7dcfff;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --radius:    8px;
  --radius-sm: 5px;
  --maxw:      780px;
  --shadow:    0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 32px -16px rgba(0,0,0,0.7);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f7f8fc;
    --bg-2:      #eef0f7;
    --surface:   #ffffff;
    --surface-2: #f1f3fb;
    --border:    #e1e4ee;
    --border-2:  #cbd0df;
    --text:      #1a1d24;
    --text-dim:  #353a47;
    --muted:     #6f7689;
    --accent:    #3b5bdb;
    --accent-2:  #8a4fbf;
    --green:     #1f8a47;
    --yellow:    #b07b00;
    --red:       #d63b56;
    --cyan:      #0b80a6;
    --shadow:    0 8px 24px -16px rgba(20, 25, 40, 0.18);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark light; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, color-mix(in oklab, var(--accent-2) 7%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
.hero-avatar { max-width: none; }

code, pre, kbd, samp { font-family: var(--mono); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; gap: 12px;
}
.brand {
  font-family: var(--mono);
  color: var(--text); display: inline-flex; gap: 6px; align-items: baseline;
  font-size: 0.95rem;
}
.brand:hover { text-decoration: none; }
.brand-prompt { color: var(--green); font-weight: 600; }
.brand strong { font-weight: 600; letter-spacing: -0.01em; }
.brand-owner { color: var(--muted); font-size: 0.85rem; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }
.lang-switch {
  font-family: var(--mono);
  border: 1px solid var(--border);
  padding: 4px 8px !important;
  border-radius: var(--radius-sm);
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim) !important;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent) !important; background: transparent !important; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 54px 0 32px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 28px;
}
.hero-profile {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hero-avatar {
  width: 52px !important;
  height: 52px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--accent) 28%, var(--surface));
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.7);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.hero-copy { min-width: 0; }
.hero h1 {
  font-family: var(--sans);
  font-size: 2.1rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero h1::before {
  content: "> ";
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
}
.hero p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.92rem; }

@media (max-width: 600px) {
  .hero-profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hero-avatar {
    width: 44px;
    height: 44px;
  }
}

/* ── Feed ──────────────────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 60px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.card:hover { border-color: var(--border-2); }
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 2px; border-radius: 0 2px 2px 0;
  background: var(--accent);
  opacity: 0.55;
}
.card-share::before { background: var(--accent-2); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.card-head time { color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
}
.badge::before { content: "#"; opacity: 0.7; }
.badge-share {
  background: color-mix(in oklab, var(--accent-2) 12%, transparent);
  color: var(--accent-2);
  border-color: color-mix(in oklab, var(--accent-2) 25%, transparent);
}

/* Post card */
.card-post .card-title { margin: 4px 0 8px; font-size: 1.22rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.card-post .card-title a { color: var(--text); }
.card-post .card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--text-dim); margin: 0 0 12px; font-size: 0.96rem; }
.card-more {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}
.card-more::before { content: "$ "; color: var(--green); opacity: 0.85; }

/* Share card */
.share-note { margin: 4px 0 12px; color: var(--text-dim); }
.link-preview {
  display: flex; gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  color: var(--text);
  min-height: 110px;
  align-items: stretch;
  transition: border-color 0.15s ease;
}
.link-preview:hover {
  text-decoration: none;
  border-color: color-mix(in oklab, var(--accent-2) 50%, var(--border));
}
.lp-image {
  flex: 0 0 38%;
  background-size: cover; background-position: center; background-color: #000;
  border-right: 1px solid var(--border);
}
.lp-body { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.lp-site {
  font-family: var(--mono);
  font-size: 0.72rem; color: var(--muted);
  text-transform: lowercase;
}
.lp-site::before { content: "→ "; color: var(--accent-2); }
.lp-title { font-weight: 600; line-height: 1.32; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lp-desc { color: var(--muted); font-size: 0.88rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 520px) {
  .link-preview { flex-direction: column; }
  .lp-image { flex: 0 0 160px; border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ── Single post ───────────────────────────────────────────────────────── */
.post { padding: 28px 0 60px; }
.post-head h1 {
  font-size: 2rem; margin: 0 0 8px;
  letter-spacing: -0.02em; line-height: 1.2; font-weight: 700;
}
.post-head .meta {
  color: var(--muted); font-size: 0.82rem; margin: 0 0 28px;
  font-family: var(--mono);
}
.post-head .meta time::before { content: "// "; color: var(--muted); }
.post-head .dot { margin: 0 8px; opacity: 0.5; }
.lang-link { color: var(--accent); }

.post-body { font-size: 1.02rem; color: var(--text-dim); }
.post-body h1, .post-body h2, .post-body h3 {
  color: var(--text); margin-top: 1.8em; letter-spacing: -0.01em;
}
.post-body h2::before, .post-body h3::before {
  content: "#"; color: var(--accent); margin-right: 0.4em; font-family: var(--mono); opacity: 0.6;
}
.post-body h3::before { content: "##"; }
.post-body a { color: var(--accent); border-bottom: 1px dashed color-mix(in oklab, var(--accent) 50%, transparent); }
.post-body a:hover { border-bottom-style: solid; text-decoration: none; }
.post-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 14px 16px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 0.88rem; line-height: 1.55;
}
.post-body code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; font-size: 0.88em;
  color: var(--cyan);
}
.post-body pre code { background: transparent; border: 0; padding: 0; color: var(--text); }
.post-body blockquote {
  border-left: 3px solid var(--accent-2);
  margin: 1.2em 0; padding: 4px 16px;
  color: var(--muted); background: color-mix(in oklab, var(--accent-2) 5%, transparent);
}
.post-body img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li { margin: 0.25em 0; }
.post-body hr { border: 0; border-top: 1px dashed var(--border); margin: 2em 0; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px; margin-top: 60px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.site-footer .bio { margin: 0 0 12px; font-family: var(--sans); color: var(--text-dim); }
.socials { list-style: none; padding: 0; margin: 0 0 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.socials li {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  transition: border-color 0.15s ease;
}
.socials li:hover { border-color: var(--accent); }
.socials a { color: var(--text-dim); }
.socials a::before { content: "/"; color: var(--muted); margin-right: 4px; }
.socials a:hover { color: var(--accent); text-decoration: none; }
.copy { font-size: 0.78rem; color: var(--muted); }
.copy::before { content: "// "; }

/* ── Forms / admin ─────────────────────────────────────────────────────── */
.auth-card {
  max-width: 380px; margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin-top: 0; font-size: 1.4rem; }
.auth-card h1::before { content: "$ "; color: var(--green); font-family: var(--mono); }

label { display: block; margin: 14px 0; }
label > span {
  display: block; color: var(--muted); margin-bottom: 6px;
  font-size: 0.82rem; font-family: var(--mono); letter-spacing: 0.02em;
}
input[type=text], input[type=password], input[type=url], textarea {
  width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=url]:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
textarea {
  font-family: var(--mono);
  font-size: 0.9rem; line-height: 1.55;
  resize: vertical;
}
.checkbox { display: flex; gap: 8px; align-items: center; }
.checkbox > span { margin: 0; font-family: var(--sans); }
.checkbox input { accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0b0d12;
  font: inherit; font-family: var(--mono); font-size: 0.86rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-quiet {
  background: transparent; color: var(--text-dim); border-color: var(--border);
}
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-family: var(--mono); font-size: 0.85rem; }
.btn-link.danger { color: var(--red); }
.btn-link:hover { text-decoration: underline; }
.inline { display: inline; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.error {
  background: color-mix(in oklab, var(--red) 14%, transparent);
  color: var(--red); padding: 10px 14px;
  border: 1px solid color-mix(in oklab, var(--red) 35%, transparent);
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-family: var(--mono); font-size: 0.88rem;
}
.error::before { content: "✕ "; }
.hint { color: var(--muted); font-size: 0.85rem; font-family: var(--mono); }

.editor { padding: 28px 0 60px; }
.editor h1 { margin-top: 0; font-size: 1.5rem; }
.editor h1::before { content: "$ "; color: var(--green); font-family: var(--mono); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.admin-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0 8px; flex-wrap: wrap; gap: 12px;
}
.admin-bar h1 { margin: 0; font-size: 1.4rem; }
.admin-bar h1::before { content: "$ "; color: var(--green); font-family: var(--mono); }
.admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-section { margin-top: 32px; }
.admin-section h2 { font-family: var(--mono); font-size: 0.95rem; color: var(--text-dim); margin: 0 0 10px; letter-spacing: 0.02em; }
.admin-section h2::before { content: "// "; color: var(--muted); }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th {
  background: var(--bg-2);
  color: var(--muted); font-weight: 500;
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.admin-table td.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { white-space: nowrap; display: flex; gap: 12px; align-items: center; }
.muted { color: var(--muted); }

.empty-page { text-align: center; padding: 100px 0; }
.empty-page h1 { font-size: 4rem; margin: 0; font-family: var(--mono); color: var(--accent); }
.empty-page p { color: var(--muted); font-family: var(--mono); }
.empty { padding: 80px 0; text-align: center; color: var(--muted); font-family: var(--mono); }
.empty::before { content: "// "; }
