
/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; overflow-y: scroll; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { scrollbar-width: none !important; -ms-overflow-style: none !important; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: #fff; color: #111827;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }

/* ── CSS VARIABLES ── */
:root {
  --p:   #4361ee;
  --pd:  #3451d1;
  --pl:  #eef0fd;
  --t9:  #0f172a;
  --t7:  #1e293b;
  --t5:  #64748b;
  --t4:  #94a3b8;
  --t3:  #cbd5e1;
  --bg:  #ffffff;
  --bg2: #f8fafc;
  --bg3: #f1f5f9;
  --bd:  #e2e8f0;
  --bdl: #f1f5f9;
  --sh1: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --sh2: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --sh3: 0 12px 32px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --r:   14px;
  --rl:  18px;
  --rxl: 24px;
  --nh:  62px;
}

/* ── NAVBAR ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nh);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bd);
  z-index: 500;
}
.nav-in {
  max-width: 1600px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 0;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.12rem;
  color: var(--t9); flex-shrink: 0; margin-right: 8px;
}
.lbox {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--p); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; flex-shrink: 0;
}
.sp { flex: 1; min-width: 8px; }
.nav-r { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.nblog {
  padding: 8px 16px; border-radius: 8px;
  font-size: .88rem; font-weight: 700;
  color: var(--t7); transition: all .15s; white-space: nowrap;
}
.nblog:hover { color: var(--t9); background: var(--bg2); }
.ndark {
  width: 33px; height: 33px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--t5); font-size: .88rem; transition: all .15s;
}
.ndark:hover { background: var(--bg2); color: var(--t9); }
.nav-home {
  padding: 8px 18px; border-radius: 8px;
  font-size: .88rem; font-weight: 700;
  color: var(--t7); transition: all .15s; display: flex; align-items: center; gap: 6px;
}
.nav-home:hover { color: var(--t9); background: var(--bg2); }

/* ── 404 MAIN CONTENT ── */
.page-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--nh) + 40px) 24px 60px;
  position: relative; overflow: hidden;
}

/* Background blobs */
.page-wrap::before {
  content: ''; position: absolute; top: 10%; left: -5%;
  width: 50%; height: 60%; pointer-events: none;
  background: radial-gradient(ellipse at 30% 40%, rgba(67,97,238,.06) 0%, transparent 65%);
}
.page-wrap::after {
  content: ''; position: absolute; bottom: 10%; right: -5%;
  width: 50%; height: 60%; pointer-events: none;
  background: radial-gradient(ellipse at 70% 60%, rgba(124,58,237,.05) 0%, transparent 65%);
}

/* Floating grid dots background */
.dots-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
  background-image: radial-gradient(circle, rgba(67,97,238,.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
}

.inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; max-width: 560px;
}

/* Giant 404 number */
.err-num {
  font-family: 'Sora', sans-serif;
  font-size: clamp(7rem, 20vw, 13rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: transparent;
  background: linear-gradient(135deg, var(--p) 0%, #7c3aed 60%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 4px;
  animation: numPop .7s cubic-bezier(.34,1.56,.64,1) both;
  position: relative;
  user-select: none;
}

/* Glitch line on 404 */
.err-num::after {
  content: '404';
  position: absolute; inset: 0;
  color: transparent;
  background: linear-gradient(135deg, var(--p) 0%, #7c3aed 60%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0;
  animation: glitch 4s infinite 2s;
}

@keyframes glitch {
  0%, 90%, 100% { opacity: 0; clip-path: none; transform: none; }
  92% { opacity: .6; clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
  94% { opacity: .6; clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); }
  96% { opacity: 0; }
}

@keyframes numPop {
  from { opacity: 0; transform: scale(.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Icon badge */
.err-badge {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--p), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 12px 32px rgba(67,97,238,.28);
  animation: badgePop .6s cubic-bezier(.34,1.56,.64,1) .15s both;
}
@keyframes badgePop {
  from { opacity: 0; transform: scale(.5) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.err-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800; color: var(--t9);
  letter-spacing: -.02em; margin-bottom: 12px;
  animation: fadeUp .5s ease .25s both;
}
.err-desc {
  font-size: .98rem; color: var(--t5); line-height: 1.75;
  max-width: 420px; margin: 0 auto 32px;
  animation: fadeUp .5s ease .35s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* CTA buttons */
.err-btns {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 48px;
  animation: fadeUp .5s ease .45s both;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-size: .9rem; font-weight: 700;
  background: var(--p); color: #fff;
  transition: all .18s; box-shadow: 0 4px 14px rgba(67,97,238,.3);
}
.btn-primary:hover { background: var(--pd); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(67,97,238,.38); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-size: .9rem; font-weight: 700;
  background: #fff; color: var(--t7);
  border: 1.5px solid var(--bd);
  transition: all .18s;
}
.btn-secondary:hover { border-color: var(--p); color: var(--p); transform: translateY(-2px); box-shadow: var(--sh2); }

/* Quick links section */
.ql-title {
  font-size: .67rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--t4); margin-bottom: 14px;
  animation: fadeUp .5s ease .5s both;
}
.ql-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  width: 100%; max-width: 500px;
  animation: fadeUp .5s ease .55s both;
}
.ql-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 10px; border-radius: 12px;
  background: var(--bg2); border: 1.5px solid var(--bdl);
  font-size: .78rem; font-weight: 600; color: var(--t5);
  transition: all .16s; cursor: pointer;
}
.ql-item:hover { background: var(--pl); border-color: var(--p); color: var(--p); transform: translateY(-2px); box-shadow: var(--sh1); }
.ql-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #fff;
}

/* Search bar */
.err-search {
  width: 100%; max-width: 420px; margin-bottom: 32px;
  animation: fadeUp .5s ease .4s both;
}
.search-wrap {
  display: flex; align-items: center;
  background: var(--bg2); border: 1.5px solid var(--bd);
  border-radius: 10px; padding: 4px 4px 4px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within { border-color: var(--p); box-shadow: 0 0 0 3px rgba(67,97,238,.1); }
.search-wrap input {
  flex: 1; border: none; background: none; outline: none;
  font-family: 'Manrope', sans-serif; font-size: .88rem; color: var(--t7);
  padding: 8px 0;
}
.search-wrap input::placeholder { color: var(--t4); }
.search-btn {
  padding: 8px 16px; border-radius: 7px;
  background: var(--p); color: #fff;
  font-size: .82rem; font-weight: 700;
  transition: background .15s; flex-shrink: 0;
}
.search-btn:hover { background: var(--pd); }

/* ── FOOTER ── */
.foot {
  background: #0f172a; color: rgba(255,255,255,.52);
  padding: 48px 24px 26px; border-top: 1px solid var(--bd);
}
.foot-in { max-width: 1600px; margin: 0 auto; }
.fgrid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px; margin-bottom: 40px;
}
.fbrand-logo {
  display: flex; align-items: center; gap: 8px; margin-bottom: 11px;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.05rem; color: #fff;
}
.fdesc { font-size: .82rem; line-height: 1.7; color: rgba(255,255,255,.38); max-width: 240px; }
.fct {
  font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255,255,255,.28); margin-bottom: 12px;
}
.flinks { display: flex; flex-direction: column; gap: 8px; }
.flinks a { font-size: .84rem; color: rgba(255,255,255,.48); transition: color .14s; }
.flinks a:hover { color: rgba(255,255,255,.88); }
.fbot {
  border-top: 1px solid rgba(255,255,255,.07); padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; font-size: .78rem; color: rgba(255,255,255,.25);
}
.fbotlinks { display: flex; gap: 16px; }
.fbotlinks a { color: rgba(255,255,255,.25); transition: color .14s; }
.fbotlinks a:hover { color: rgba(255,255,255,.6); }

/* ── DARK MODE ── */
body.dark {
  --p:   #818cf8;
  --pd:  #6366f1;
  --pl:  #1e1b4b;
  --t9:  #f1f5f9;
  --t7:  #e2e8f0;
  --t5:  #94a3b8;
  --t4:  #64748b;
  --t3:  #334155;
  --bg:  #0f172a;
  --bg2: #1e293b;
  --bg3: #273548;
  --bd:  #334155;
  --bdl: #1e293b;
  background: var(--bg); color: var(--t7);
}
body.dark .nav    { background: rgba(15,23,42,.97); border-bottom-color: var(--bd); }
body.dark .page-wrap { background: var(--bg); }
body.dark .dots-bg { background-image: radial-gradient(circle, rgba(129,140,248,.07) 1px, transparent 1px); }
body.dark .btn-secondary { background: var(--bg2); border-color: var(--bd); color: var(--t5); }
body.dark .btn-secondary:hover { border-color: var(--p); color: var(--p); }
body.dark .ql-item { background: var(--bg2); border-color: var(--bdl); }
body.dark .search-wrap { background: var(--bg2); border-color: var(--bd); }
body.dark .search-wrap input { color: var(--t7); }
body.dark .foot   { background: #060d1a; border-top-color: var(--bd); }
body.dark .ndark i::before { content: "\f185"; }
body.dark .page-wrap::before { background: radial-gradient(ellipse at 30% 40%, rgba(129,140,248,.07) 0%, transparent 65%); }
body.dark .page-wrap::after  { background: radial-gradient(ellipse at 70% 60%, rgba(99,102,241,.06) 0%, transparent 65%); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .ql-grid { grid-template-columns: repeat(2, 1fr); }
  .err-btns { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-secondary { justify-content: center; }
}
@media (max-width: 900px) {
  .fgrid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fbrand { grid-column: 1 / -1; }
  .fdesc  { max-width: 100%; }
}
@media (max-width: 480px) {
  .foot  { padding: 36px 16px 22px; }
  .fgrid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .fbot  { flex-direction: column; text-align: center; }
  .fbotlinks { justify-content: center; }
}