:root {
  --bg: #0a0a0b;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --border: #232329;
  --text: #f2f2f0;
  --muted: #8d8d96;
  --accent: #5ce1e6;
  --accent-dim: rgba(92, 225, 230, 0.12);
  --danger: #e65c6b;
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------- header */
.site-header {
  max-width: 1080px; margin: 0 auto;
  padding: 28px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em;
  position: relative;
}
.brand-f { color: var(--accent); }
.brand-splash {
  position: absolute; top: -6px; right: -16px;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  opacity: 0.9;
}
.brand-splash::after {
  content: ''; position: absolute; top: -5px; right: -6px;
  width: 5px; height: 5px; background: var(--accent);
  border-radius: 50% 60% 40% 50%;
}
.site-header nav { display: flex; gap: 24px; font-size: 0.92rem; color: var(--muted); }
.site-header nav a:hover { color: var(--text); }

/* ---------------------------------- hero */
.hero { padding: 64px 0 40px; position: relative; max-width: 760px; }
.hero::before {
  content: ''; position: absolute; top: 0; left: -120px;
  width: 380px; height: 380px; pointer-events: none;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 65%);
}
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.02em;
}
.accent { color: var(--accent); }
.hero-sub { color: var(--muted); margin-top: 18px; font-size: 1.05rem; max-width: 540px; }

/* ---------------------------------- filters */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.filters a {
  padding: 7px 16px; border-radius: 100px;
  font-size: 0.88rem; color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.filters a:hover { color: var(--text); border-color: var(--muted); }
.filters a.active { background: var(--accent); color: #06090a; border-color: var(--accent); font-weight: 600; }

/* ---------------------------------- article grid */
.article-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; padding-bottom: 80px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-meta { display: flex; align-items: center; gap: 12px; }
.tag {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim);
  padding: 4px 10px; border-radius: 100px; font-weight: 600;
}
.date { font-size: 0.82rem; color: var(--muted); }
.card h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em;
}
.card p { color: var(--muted); font-size: 0.95rem; }
.read-more { margin-top: auto; font-size: 0.86rem; color: var(--accent); font-weight: 500; }

.empty { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------------------------------- article page */
.post { max-width: 720px; margin: 0 auto; padding: 56px 0 80px; }
.post-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600; line-height: 1.2; letter-spacing: -0.02em;
  margin: 18px 0 12px;
}
.post-excerpt { color: var(--muted); font-size: 1.1rem; }
.post-body { margin-top: 40px; font-size: 1.05rem; }
.post-body h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 40px 0 14px; font-weight: 600; }
.post-body h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 32px 0 12px; font-weight: 600; }
.post-body p { margin-bottom: 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px 24px; }
.post-body li { margin-bottom: 8px; }
.post-body a { color: var(--accent); }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px; margin: 24px 0;
  color: var(--muted); font-style: italic;
}
.post-body code {
  background: var(--surface-2); padding: 2px 7px; border-radius: 6px;
  font-size: 0.9em;
}
.post-body img { max-width: 100%; border-radius: 12px; margin: 12px 0; }
.post-admin { margin-top: 48px; }
.back-link { display: inline-block; margin-top: 40px; color: var(--muted); font-size: 0.92rem; }
.back-link:hover { color: var(--accent); }

/* ---------------------------------- buttons & forms */
.btn {
  display: inline-block;
  background: var(--accent); color: #06090a;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  padding: 11px 22px; border-radius: 100px;
  border: 1px solid var(--accent); cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); opacity: 1; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

label { display: block; font-size: 0.88rem; font-weight: 500; margin: 20px 0 8px; }
.muted { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--font-body); font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 0.88rem; margin-top: 10px; }

/* ---------------------------------- auth */
.auth { max-width: 420px; margin: 0 auto; padding: 90px 0; }
.auth h1 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }
.auth-form button { margin-top: 24px; width: 100%; }

/* ---------------------------------- dashboard */
.dash { padding: 48px 0 80px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.dash-head h1 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.dash-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.dash-table td a:hover { color: var(--accent); }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions form { display: inline; }

/* ---------------------------------- editor */
.editor { padding: 48px 0 80px; }
.editor h1 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }
.editor-row { display: flex; gap: 24px; align-items: end; }
.editor-row > div:first-child { flex: 1; }
.editor-check label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-split textarea { min-height: 480px; resize: vertical; line-height: 1.6; }
.preview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; min-height: 480px;
  overflow-y: auto; margin-top: 0; font-size: 0.95rem;
}
.editor-actions { margin-top: 28px; display: flex; gap: 12px; }

/* ---------------------------------- footer */
.site-footer {
  max-width: 1080px; margin: 0 auto;
  padding: 40px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  color: var(--muted); font-size: 0.88rem;
}
.brand-small { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--text); }
.site-footer p { margin-top: 6px; max-width: 380px; }
.footer-meta a { color: var(--accent); }

/* ---------------------------------- cover image */
.post-cover {
  width: 100%; margin-bottom: 40px;
  border-radius: 16px; overflow: hidden;
  max-height: 420px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------------------------- share bar */
.share-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-top: 56px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.share-label { font-size: 0.88rem; color: var(--muted); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 100px;
  font-size: 0.84rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all 0.15s ease;
  text-decoration: none;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-linkedin:hover { border-color: #0a66c2; color: #0a66c2; }

.post-meta-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 16px; flex-wrap: wrap;
}
.post-meta-author { display: flex; align-items: center; gap: 10px; }
.post-meta-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--accent);
}
.post-meta-name { font-size: 0.92rem; font-weight: 500; }
.post-meta-right { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.post-meta-sep { color: var(--border); }
.post-meta-date, .post-meta-read { color: var(--muted); }

/* ---------------------------------- animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-head { animation: fadeInUp 0.5s ease both; }
.post-body > * { opacity: 0; animation: fadeInUp 0.5s ease both; }
.post-body > *:nth-child(1) { animation-delay: 0.1s; }
.post-body > *:nth-child(2) { animation-delay: 0.15s; }
.post-body > *:nth-child(3) { animation-delay: 0.2s; }
.post-body > *:nth-child(4) { animation-delay: 0.25s; }
.post-body > *:nth-child(5) { animation-delay: 0.3s; }
.post-body > *:nth-child(6) { animation-delay: 0.35s; }
.post-body > *:nth-child(7) { animation-delay: 0.4s; }
.post-body > *:nth-child(8) { animation-delay: 0.45s; }
.post-body > *:nth-child(n+9) { animation-delay: 0.5s; }

.stat-box { transition: transform 0.2s ease, border-color 0.2s ease; }
.stat-box:hover { transform: translateY(-4px); border-color: var(--accent); }

.callout { transition: background 0.2s ease; }
.callout:hover { background: rgba(92, 225, 230, 0.18); }

.card { transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease; }
.card:hover { box-shadow: 0 8px 32px rgba(92, 225, 230, 0.08); }

/* ---------------------------------- article layout utilities */
.callout {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 32px 0;
}
.callout p { margin-bottom: 0; }

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin: 32px 0;
  text-align: center;
}
.stat-box .stat-number {
  font-family: var(--font-display);
  font-size: 3rem; font-weight: 700;
  color: var(--accent); line-height: 1;
  display: block; margin-bottom: 10px;
}
.stat-box .stat-label {
  color: var(--muted); font-size: 0.95rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 32px 0;
}
.stat-grid .stat-box { margin: 0; }

.highlight-block {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 28px 32px;
  margin: 32px 0;
}
.highlight-block h2, .highlight-block h3 {
  margin-top: 0;
}

.quote-block {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px;
  margin: 40px 0;
  position: relative;
}
.quote-block::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 5rem; line-height: 1;
  color: var(--accent); opacity: 0.3;
  position: absolute; top: 10px; left: 24px;
}
.quote-block p {
  font-size: 1.2rem; font-style: italic;
  padding-left: 20px; margin-bottom: 0;
}
.quote-block .quote-author {
  display: block; margin-top: 14px;
  font-size: 0.88rem; color: var(--muted);
  padding-left: 20px; font-style: normal;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

.tag-inline {
  display: inline-block;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim);
  padding: 4px 10px; border-radius: 100px; font-weight: 600;
  margin-bottom: 12px;
}

/* ---------------------------------- author card */
.author-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-top: 64px;
}
.author-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--accent);
}
.author-info { display: flex; flex-direction: column; gap: 6px; }
.author-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
}
.author-bio { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.author-link {
  display: inline-block; margin-top: 8px;
  font-size: 0.88rem; color: var(--accent); font-weight: 500;
}
.author-link:hover { text-decoration: underline; }

/* ---------------------------------- responsive */
@media (max-width: 760px) {
  .editor-split { grid-template-columns: 1fr; }
  .preview { min-height: 200px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .dash-table th:nth-child(3), .dash-table td:nth-child(3) { display: none; }
}
