:root {
  --bg: #0a0e1a;
  --bg2: #0f1524;
  --card: #131a2e;
  --border: #1f2a45;
  --text: #e8edf7;
  --muted: #8b96b0;
  --acc: #4f7cff;
  --acc2: #9d5cff;
  --grad: linear-gradient(135deg, #4f7cff, #9d5cff);
  --radius: 14px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  line-height: 1.6; overflow-x: hidden; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: Consolas, monospace; font-size: .85em; }

/* background grid + glow */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(79,124,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(79,124,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.cursor-glow {
  position: fixed; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,124,255,.12), transparent 60%);
  pointer-events: none; z-index: -1; transform: translate(-50%, -50%);
  transition: opacity .3s;
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px); background: rgba(10,14,26,.75);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
  box-shadow: 0 4px 16px rgba(79,124,255,.4);
}
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: .95rem;
  transition: all .2s;
}
.main-nav a:hover { color: var(--text); background: var(--card); }
.main-nav a.active { color: var(--text); background: var(--card); }
.search-form input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 14px; width: 160px; font-size: .9rem;
  transition: all .2s; outline: none;
}
.search-form input:focus { border-color: var(--acc); width: 220px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* hero */
.hero { padding: 90px 0 60px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.hero-tag { font-family: Consolas, monospace; color: var(--acc); font-size: .95rem; }
.hero-title { font-size: 3.4rem; line-height: 1.1; font-weight: 800; margin: 16px 0; letter-spacing: -.02em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 480px; }
.hero-actions { display: flex; gap: 14px; margin: 28px 0; }
.hero-stats { display: flex; gap: 36px; margin-top: 36px; }
.hstat b { font-size: 1.6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hstat span { display: block; color: var(--muted); font-size: .85rem; }
.hero-card {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4/3;
  border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transition: transform .4s;
}
.hero-card:hover { transform: translateY(-6px) scale(1.01); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card-overlay {
  position: absolute; inset: 0; padding: 28px;
  background: linear-gradient(180deg, transparent 30%, rgba(10,14,26,.95));
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
}
.hero-card-overlay h2 { font-size: 1.3rem; line-height: 1.3; }
.hero-card-overlay p { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px;
  border-radius: 10px; font-weight: 600; font-size: .95rem; border: none;
  cursor: pointer; transition: all .25s; font-family: var(--font);
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 24px rgba(79,124,255,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(79,124,255,.5); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--acc); background: var(--card); }

/* sections & cards */
.section { padding: 48px 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.section-head h2, .page-head h1 { font-size: 1.8rem; font-weight: 700; }
.page-head { padding: 48px 24px 8px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  color: var(--muted); font-size: .85rem; transition: all .2s;
}
.chip:hover, .chip-active { border-color: var(--acc); color: var(--text); background: rgba(79,124,255,.12); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, border-color .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); border-color: rgba(79,124,255,.5); box-shadow: 0 16px 48px rgba(0,0,0,.4); }
.card-img-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; display: block; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img { transform: scale(1.05); }
.card-img-empty { background: linear-gradient(135deg, #1a2340, #131a2e); }
.card-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; backdrop-filter: blur(8px);
}
.badge-news { background: rgba(79,124,255,.85); color: #fff; }
.badge-article { background: rgba(157,92,255,.85); color: #fff; }
.hero-card-overlay .card-badge { position: static; align-self: flex-start; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: .8rem; }
.card-cat { color: var(--acc); font-weight: 600; }
.card-date { color: var(--muted); }
.card-title { font-size: 1.1rem; line-height: 1.35; }
.card-title a:hover { color: var(--acc); }
.card-excerpt { color: var(--muted); font-size: .9rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.card-views { color: var(--muted); }
.card-more { color: var(--acc); font-weight: 600; }

/* post page */
.post { padding: 48px 24px; }
.post-head h1 { font-size: 2.2rem; line-height: 1.25; margin: 16px 0; letter-spacing: -.01em; }
.post-meta { display: flex; gap: 20px; color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.post-hero-img { border-radius: var(--radius); margin-bottom: 32px; max-height: 480px; width: 100%; object-fit: cover; }
.post-content { font-size: 1.08rem; color: #cfd8ec; }
.post-content p { margin: 18px 0; }
.post-content h2 { font-size: 1.5rem; margin: 36px 0 16px; color: var(--text); }
.post-content h3 { font-size: 1.25rem; margin: 28px 0 12px; color: var(--text); }
.post-content ul { margin: 16px 0 16px 24px; }
.post-content li { margin: 8px 0; }
.post-content blockquote {
  border-left: 3px solid var(--acc); padding: 12px 20px; margin: 24px 0;
  background: rgba(79,124,255,.07); border-radius: 0 10px 10px 0; font-style: italic;
}
.post-content code { background: var(--bg2); padding: 2px 7px; border-radius: 6px; font-size: .9em; }
.post-content a { color: var(--acc); border-bottom: 1px dashed var(--acc); }
.post-content img { border-radius: var(--radius); margin: 24px 0; }

/* misc pages */
.search-big { display: flex; gap: 12px; margin-top: 20px; }
.search-big input {
  flex: 1; background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 14px 18px; font-size: 1rem; outline: none;
}
.search-big input:focus { border-color: var(--acc); }
.search-info { color: var(--muted); margin-top: 14px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); color: var(--muted);
}
.pagination a:hover, .pagination .page-active { border-color: var(--acc); color: var(--text); background: rgba(79,124,255,.12); }
.about-text { font-size: 1.15rem; color: #cfd8ec; }
.contact-block { margin-top: 48px; }
.contact-links { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.contact-chip {
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 10px;
  transition: all .2s;
}
.contact-chip:hover { border-color: var(--acc); background: var(--card); }
.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; margin-top: 16px; }
.contact-form input, .contact-form textarea {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px 16px; font-size: .95rem; outline: none; font-family: var(--font);
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--acc); }
.alert { padding: 14px 18px; border-radius: 10px; margin: 16px 0; font-size: .95rem; }
.alert-ok { background: rgba(52,199,123,.15); border: 1px solid rgba(52,199,123,.4); color: #6fe3a5; }
.alert-err { background: rgba(255,90,90,.12); border: 1px solid rgba(255,90,90,.4); color: #ff9a9a; }
.notfound { text-align: center; padding: 100px 24px; }
.notfound-code { font-size: 6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound p { color: var(--muted); margin: 16px 0 28px; }

/* cta */
.cta-block {
  background: linear-gradient(135deg, rgba(79,124,255,.15), rgba(157,92,255,.12));
  border: 1px solid rgba(79,124,255,.3); border-radius: 20px;
  padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cta-block p { color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; background: var(--bg2); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 48px 24px 32px; }
.footer-col h4 { font-size: .9rem; margin-bottom: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.footer-col ul { list-style: none; }
.footer-col li { margin: 8px 0; }
.footer-col a { color: var(--muted); font-size: .92rem; transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-text { color: var(--muted); font-size: .92rem; margin-top: 14px; max-width: 340px; }
.footer-bottom {
  display: flex; justify-content: space-between; padding: 20px 24px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem;
}

/* reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 40px; width: 380px; }
.login-box h1 { font-size: 1.3rem; margin: 20px 0; }
.login-back { display: inline-block; margin-top: 20px; color: var(--muted); font-size: .9rem; }

/* responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding: 50px 0 30px; }
  .hero-title { font-size: 2.4rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px;
  }
  .main-nav.open { display: flex; }
  .search-form input { width: 120px; }
  .nav-toggle { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, .reveal { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
